summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-06-07 18:16:32 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-06-07 18:16:32 -0400
commit99dd271c06719de67b711329bc45c820504e0b2b (patch)
tree5ae165dacd9ecfcd51c74b9808334e1f5c9f5c13
parent935e0cde8b45c3c4158fa4a0b7358b3c031f63e4 (diff)
downloadchat-99dd271c06719de67b711329bc45c820504e0b2b.tar.gz
chat-99dd271c06719de67b711329bc45c820504e0b2b.tar.bz2
chat-99dd271c06719de67b711329bc45c820504e0b2b.zip
Join team correctly when signing up with LDAP (#3287)
-rw-r--r--webapp/components/signup_user_complete.jsx34
1 files changed, 28 insertions, 6 deletions
diff --git a/webapp/components/signup_user_complete.jsx b/webapp/components/signup_user_complete.jsx
index b3825f72f..a9d96e320 100644
--- a/webapp/components/signup_user_complete.jsx
+++ b/webapp/components/signup_user_complete.jsx
@@ -173,11 +173,24 @@ export default class SignupUserComplete extends React.Component {
this.state.ldapPassword,
null,
() => {
- GlobalActions.emitInitialLoad(
- () => {
- browserHistory.push('/select_team');
- }
- );
+ 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.finishSignup();
+ },
+ () => {
+ // there's not really a good way to deal with this, so just let the user log in like normal
+ this.finishSignup();
+ }
+ );
+
+ return;
+ }
+
+ this.finishSignup();
},
(err) => {
if (err.id === 'ent.ldap.do_login.user_not_registered.app_error' || err.id === 'ent.ldap.do_login.user_filtered.app_error') {
@@ -205,6 +218,15 @@ export default class SignupUserComplete extends React.Component {
);
}
+ finishSignup() {
+ GlobalActions.emitInitialLoad(
+ () => {
+ GlobalActions.loadDefaultLocale();
+ browserHistory.push('/select_team');
+ }
+ );
+ }
+
handleUserCreated(user, data) {
track('signup', 'signup_user_02_complete');
Client.loginById(
@@ -761,4 +783,4 @@ export default class SignupUserComplete extends React.Component {
</div>
);
}
-} \ No newline at end of file
+}