From 5ac9053b5acc5244f5b0e967983d174f0e3d44ce Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Sun, 5 Jun 2016 02:44:54 -0400 Subject: Added sign in link to the signup_user_complete page (#3248) --- webapp/components/login/login_controller.jsx | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'webapp/components/login') 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 { ); } -} - -LoginController.defaultProps = { -}; -LoginController.propTypes = { - params: React.PropTypes.object.isRequired -}; +} \ No newline at end of file -- cgit v1.2.3-1-g7c22