diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-06-05 02:44:54 -0400 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-06-05 03:44:54 -0300 |
commit | 5ac9053b5acc5244f5b0e967983d174f0e3d44ce (patch) | |
tree | 3e78c41a382e1a2a2ecd2691bdec8601ee61e203 /webapp/components/login/login_controller.jsx | |
parent | 919eea73b6134e6bc0277b7a29d8dc687ff52bf7 (diff) | |
download | chat-5ac9053b5acc5244f5b0e967983d174f0e3d44ce.tar.gz chat-5ac9053b5acc5244f5b0e967983d174f0e3d44ce.tar.bz2 chat-5ac9053b5acc5244f5b0e967983d174f0e3d44ce.zip |
Added sign in link to the signup_user_complete page (#3248)
Diffstat (limited to 'webapp/components/login/login_controller.jsx')
-rw-r--r-- | webapp/components/login/login_controller.jsx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/webapp/components/login/login_controller.jsx b/webapp/components/login/login_controller.jsx index 2422db5f7..dd4a92f92 100644 --- a/webapp/components/login/login_controller.jsx +++ b/webapp/components/login/login_controller.jsx @@ -22,6 +22,13 @@ import React from 'react'; import logoImage from 'images/logo.png'; export default class LoginController extends React.Component { + static get propTypes() { + return { + location: React.PropTypes.object.isRequired, + params: React.PropTypes.object.isRequired + }; + } + constructor(props) { super(props); @@ -128,12 +135,31 @@ export default class LoginController extends React.Component { } submit(loginId, password, token) { + this.setState({serverError: null}); + Client.webLogin( loginId, password, token, () => { - this.setState({serverError: null}); + // check for query params brought over from signup_user_complete + if (this.props.location.query.id || this.props.location.query.h) { + Client.addUserToTeamFromInvite( + this.props.location.query.d, + this.props.location.query.h, + this.props.location.query.id, + () => { + this.finishSignin(); + }, + () => { + // there's not really a good way to deal with this, so just let the user log in like normal + this.finishSignin(); + } + ); + + return; + } + this.finishSignin(); }, (err) => { @@ -503,10 +529,4 @@ export default class LoginController extends React.Component { </div> ); } -} - -LoginController.defaultProps = { -}; -LoginController.propTypes = { - params: React.PropTypes.object.isRequired -}; +}
\ No newline at end of file |