summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-07-22 15:32:39 -0400
committerJoramWilander <jwawilander@gmail.com>2015-07-22 15:32:39 -0400
commit56a0a7d1e1fbd9405559a9c6e32962155d9cc562 (patch)
tree512a3d4c6fae6225ce9a1716b94c70f59b5bdcfb /web/react/components
parent41bbbbf4462205348c978a2cce5162f73e35f6b7 (diff)
downloadchat-56a0a7d1e1fbd9405559a9c6e32962155d9cc562.tar.gz
chat-56a0a7d1e1fbd9405559a9c6e32962155d9cc562.tar.bz2
chat-56a0a7d1e1fbd9405559a9c6e32962155d9cc562.zip
only show gitlab signup/login links if gitlab oauth is turned on
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/login.jsx15
-rw-r--r--web/react/components/signup_user_complete.jsx14
2 files changed, 24 insertions, 5 deletions
diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx
index 908e10f31..05918650b 100644
--- a/web/react/components/login.jsx
+++ b/web/react/components/login.jsx
@@ -90,6 +90,17 @@ module.exports = React.createClass({
focusEmail = true;
}
+ var auth_services = JSON.parse(this.props.authServices);
+
+ var login_message;
+ if (auth_services.indexOf("gitlab") >= 0) {
+ login_message = (
+ <div className="form-group form-group--small">
+ <span><a href={"/"+teamName+"/login/gitlab"}>{"Log in with GitLab"}</a></span>
+ </div>
+ );
+ }
+
return (
<div className="signup-team__container">
<div>
@@ -112,9 +123,7 @@ module.exports = React.createClass({
<div className="form-group">
<button type="submit" className="btn btn-primary">Sign in</button>
</div>
- <div className="form-group form-group--small">
- <span><a href={"/"+teamName+"/login/gitlab"}>{"Log in with GitLab"}</a></span>
- </div>
+ { login_message }
<div className="form-group form-group--small">
<span><a href="/find_team">{"Find other " + strings.TeamPlural}</a></span>
</div>
diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx
index 577651b90..dc5ba64aa 100644
--- a/web/react/components/signup_user_complete.jsx
+++ b/web/react/components/signup_user_complete.jsx
@@ -103,7 +103,7 @@ module.exports = React.createClass({
var yourEmailIs = this.state.user.email == "" ? "" : <span>Your email address is { this.state.user.email }. </span>
- var email =
+ var email = (
<div className={ this.state.original_email == "" ? "" : "hidden"} >
<label className="control-label">Email</label>
<div className={ email_error ? "form-group has-error" : "form-group" }>
@@ -111,6 +111,16 @@ module.exports = React.createClass({
{ email_error }
</div>
</div>
+ );
+
+ var auth_services = JSON.parse(this.props.authServices);
+
+ var signup_message;
+ if (auth_services.indexOf("gitlab") >= 0) {
+ signup_message = <p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team} <a href={"/"+this.props.teamName+"/signup/gitlab"+window.location.search}>{"or sign up with GitLab."}</a></p>;
+ } else {
+ signup_message = <p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team + "."}</p>;
+ }
return (
<div>
@@ -119,7 +129,7 @@ module.exports = React.createClass({
<div className="form-group form-group--small">
<span></span>
</div>
- <p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team} <a href={"/"+this.props.teamName+"/signup/gitlab"+window.location.search}>{"or sign up with GitLab."}</a></p>
+ { signup_message }
<p>Your username can be made of lowercase letters and numbers.</p>
<label className="control-label">Username</label>
<div className={ name_error ? "form-group has-error" : "form-group" }>