summaryrefslogtreecommitdiffstats
path: root/webapp/components/login/login_controller.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/login/login_controller.jsx')
-rw-r--r--webapp/components/login/login_controller.jsx36
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