diff options
author | Corey Hulen <corey@hulen.com> | 2015-07-15 10:27:24 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-07-15 10:27:24 -0800 |
commit | d16a1d6d758c28ae2558232ba6da92798d7dfca3 (patch) | |
tree | 0da7ee5d9f4039eeb20f70940483c40943c9aa23 /web | |
parent | 38f9e140e98123eb256968fb31f7fbb2aef978e0 (diff) | |
parent | e017babc5ddd66e65469326bf723d5359875c2d1 (diff) | |
download | chat-d16a1d6d758c28ae2558232ba6da92798d7dfca3.tar.gz chat-d16a1d6d758c28ae2558232ba6da92798d7dfca3.tar.bz2 chat-d16a1d6d758c28ae2558232ba6da92798d7dfca3.zip |
Merge pull request #171 from mattermost/mm-1415
Fixes mm-1415 adding email bypass flag
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/signup_user_complete.jsx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index fa0c26017..d1053c778 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -46,25 +46,24 @@ module.exports = React.createClass({ function(data) { client.track('signup', 'signup_user_02_complete'); - if (data.email_verified) { - client.loginByEmail(this.props.domain, this.state.user.email, this.state.user.password, - function(data) { - UserStore.setLastDomain(this.props.domain); - UserStore.setLastEmail(this.state.user.email); - UserStore.setCurrentUser(data); - if (this.props.hash > 0) - BrowserStore.setGlobalItem(this.props.hash, {wizard: "finished"}); - window.location.href = '/channels/town-square'; - }.bind(this), - function(err) { + client.loginByEmail(this.props.domain, this.state.user.email, this.state.user.password, + function(data) { + UserStore.setLastDomain(this.props.domain); + UserStore.setLastEmail(this.state.user.email); + UserStore.setCurrentUser(data); + if (this.props.hash > 0) + BrowserStore.setGlobalItem(this.props.hash, JSON.stringify({wizard: "finished"})); + window.location.href = '/channels/town-square'; + }.bind(this), + function(err) { + if (err.message == "Login failed because email address has not been verified") { + window.location.href = "/verify?email="+ encodeURIComponent(this.state.user.email) + "&domain=" + encodeURIComponent(this.props.domain); + } else { this.state.server_error = err.message; this.setState(this.state); - }.bind(this) - ); - } - else { - window.location.href = "/verify?email="+ encodeURIComponent(this.state.user.email) + "&domain=" + encodeURIComponent(this.props.domain); - } + } + }.bind(this) + ); }.bind(this), function(err) { this.state.server_error = err.message; |