diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/login.jsx | 13 | ||||
-rw-r--r-- | web/react/components/signup_user_complete.jsx | 28 | ||||
-rw-r--r-- | web/react/components/signup_user_oauth.jsx | 5 |
3 files changed, 36 insertions, 10 deletions
diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index fe0a47777..5f396ac49 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -92,14 +92,21 @@ module.exports = React.createClass({ var auth_services = JSON.parse(this.props.authServices); - var login_message; - if (auth_services.indexOf("gitlab") >= 0) { - login_message = ( + var login_message = []; + if (auth_services.indexOf(Constants.GITLAB_SERVICE) >= 0) { + login_message.push( <div className="form-group form-group--small"> <span><a href={"/"+teamName+"/login/gitlab"}>{"Log in with GitLab"}</a></span> </div> ); } + if (auth_services.indexOf(Constants.GOOGLE_SERVICE) >= 0) { + login_message.push( + <div className="form-group form-group--small"> + <span><a href={"/"+teamName+"/login/google"}>{"Log in with Google"}</a></span> + </div> + ); + } return ( <div className="signup-team__container"> diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index b21553d8a..fd389e21f 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -5,6 +5,7 @@ var utils = require('../utils/utils.jsx'); var client = require('../utils/client.jsx'); var UserStore = require('../stores/user_store.jsx'); var BrowserStore = require('../stores/browser_store.jsx'); +var Constants = require('../utils/constants.jsx'); module.exports = React.createClass({ handleSubmit: function(e) { @@ -151,19 +152,34 @@ module.exports = React.createClass({ // add options to log in using another service var authServices = JSON.parse(this.props.authServices); - var signupMessage = null; - if (authServices.indexOf('gitlab') >= 0) { - signupMessage = ( - <div> + var signupMessage = []; + if (authServices.indexOf(Constants.GITLAB_SERVICE) >= 0) { + signupMessage.push( <a className='btn btn-custom-login gitlab' href={'/' + this.props.teamName + '/signup/gitlab' + window.location.search}> <span className='icon' /> <span>with GitLab</span> </a> + ); + } + + if (authServices.indexOf(Constants.GOOGLE_SERVICE) >= 0) { + signupMessage.push( + <a className='btn btn-custom-login gitlab' href={'/' + this.props.teamName + '/signup/google' + window.location.search}> + <span className='icon' /> + <span>with Google</span> + </a> + ); + } + + if (signupMessage.length > 0) { + signupMessage = ( + <div> + {signupMessage} <div className='or__container'> <span>or</span> </div> - </div> - ); + </div> + ); } var termsDisclaimer = null; diff --git a/web/react/components/signup_user_oauth.jsx b/web/react/components/signup_user_oauth.jsx index 6322aedee..8b2800bde 100644 --- a/web/react/components/signup_user_oauth.jsx +++ b/web/react/components/signup_user_oauth.jsx @@ -33,7 +33,10 @@ module.exports = React.createClass({ client.createUser(user, "", "", function(data) { client.track('signup', 'signup_user_oauth_02'); - window.location.href = '/' + this.props.teamName + '/login/'+user.auth_service; + UserStore.setCurrentUser(data); + UserStore.setLastEmail(data.email); + + window.location.href = '/' + this.props.teamName + '/login/' + user.auth_service + '?login_hint=' + user.email; }.bind(this), function(err) { this.state.server_error = err.message; |