diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2017-01-27 11:39:13 +0100 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-01-27 10:39:13 +0000 |
commit | d72547433af3ec5829ce0de4f4e1cfd440be7142 (patch) | |
tree | 6bd7664e9058468842c7b7bb7c7a76abf1b7c5e3 /webapp/components/signup | |
parent | 49c677f6b46409289210abc0e0bda63735be3e9f (diff) | |
download | chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.tar.gz chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.tar.bz2 chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.zip |
Move remaining client functions in components to actions (#5171)
Diffstat (limited to 'webapp/components/signup')
-rw-r--r-- | webapp/components/signup/components/signup_email.jsx | 26 | ||||
-rw-r--r-- | webapp/components/signup/components/signup_ldap.jsx | 4 |
2 files changed, 7 insertions, 23 deletions
diff --git a/webapp/components/signup/components/signup_email.jsx b/webapp/components/signup/components/signup_email.jsx index e8181fd23..9ed10b94c 100644 --- a/webapp/components/signup/components/signup_email.jsx +++ b/webapp/components/signup/components/signup_email.jsx @@ -6,11 +6,9 @@ import LoadingScreen from 'components/loading_screen.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; import {track} from 'actions/analytics_actions.jsx'; import {getInviteInfo} from 'actions/team_actions.jsx'; - -import BrowserStore from 'stores/browser_store.jsx'; +import {loginById, createUserWithInvite} from 'actions/user_actions.jsx'; import * as Utils from 'utils/utils.jsx'; -import Client from 'client/web_client.jsx'; import Constants from 'utils/constants.jsx'; import React from 'react'; @@ -119,26 +117,12 @@ export default class SignupEmail extends React.Component { handleSignupSuccess(user, data) { track('signup', 'signup_user_02_complete'); - Client.loginById( + loginById( data.id, user.password, '', - () => { - if (this.state.hash > 0) { - BrowserStore.setGlobalItem(this.state.hash, JSON.stringify({usedBefore: true})); - } - - GlobalActions.emitInitialLoad( - () => { - const query = this.props.location.query; - if (query.redirect_to) { - browserHistory.push(query.redirect_to); - } else { - GlobalActions.redirectUserToDefaultTeam(); - } - } - ); - }, + this.state.hash, + null, (err) => { if (err.id === 'api.user.login.not_verified.app_error') { browserHistory.push('/should_verify_email?email=' + encodeURIComponent(user.email) + '&teamname=' + encodeURIComponent(this.state.teamName)); @@ -242,7 +226,7 @@ export default class SignupEmail extends React.Component { allow_marketing: true }; - Client.createUserWithInvite(user, + createUserWithInvite(user, this.state.data, this.state.hash, this.state.inviteId, diff --git a/webapp/components/signup/components/signup_ldap.jsx b/webapp/components/signup/components/signup_ldap.jsx index 3e8b39a26..4c9afc8d6 100644 --- a/webapp/components/signup/components/signup_ldap.jsx +++ b/webapp/components/signup/components/signup_ldap.jsx @@ -6,9 +6,9 @@ import FormError from 'components/form_error.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; import {track} from 'actions/analytics_actions.jsx'; import {addUserToTeamFromInvite} from 'actions/team_actions.jsx'; +import {webLoginByLdap} from 'actions/user_actions.jsx'; import * as Utils from 'utils/utils.jsx'; -import Client from 'client/web_client.jsx'; import React from 'react'; import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; @@ -56,7 +56,7 @@ export default class SignupLdap extends React.Component { this.setState({ldapError: ''}); - Client.webLoginByLdap( + webLoginByLdap( this.state.ldapId, this.state.ldapPassword, null, |