diff options
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/actions/user_actions.jsx | 17 | ||||
-rw-r--r-- | webapp/components/do_verify_email.jsx | 15 |
2 files changed, 23 insertions, 9 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx index 94546cf36..201a648f9 100644 --- a/webapp/actions/user_actions.jsx +++ b/webapp/actions/user_actions.jsx @@ -561,3 +561,20 @@ export function updatePassword(userId, currentPassword, newPassword, success, er } ); } + +export function verifyEmail(uid, hid, success, error) { + Client.verifyEmail( + uid, + hid, + (data) => { + if (success) { + success(data); + } + }, + (err) => { + if (error) { + error(err); + } + } + ); +} diff --git a/webapp/components/do_verify_email.jsx b/webapp/components/do_verify_email.jsx index e0ac3218e..9b6a9ccad 100644 --- a/webapp/components/do_verify_email.jsx +++ b/webapp/components/do_verify_email.jsx @@ -2,11 +2,12 @@ // See License.txt for license information. import {FormattedMessage} from 'react-intl'; -import Client from 'client/web_client.jsx'; import LoadingScreen from './loading_screen.jsx'; import {browserHistory, Link} from 'react-router/es6'; +import {verifyEmail} from 'actions/user_actions.jsx'; + import React from 'react'; export default class DoVerifyEmail extends React.Component { @@ -19,15 +20,11 @@ export default class DoVerifyEmail extends React.Component { }; } componentWillMount() { - const uid = this.props.location.query.uid; - const hid = this.props.location.query.hid; - const email = this.props.location.query.email; - - Client.verifyEmail( - uid, - hid, + verifyEmail( + this.props.location.query.uid, + this.props.location.query.hid, () => { - browserHistory.push('/login?extra=verified&email=' + email); + browserHistory.push('/login?extra=verified&email=' + this.props.location.query.email); }, (err) => { this.setState({verifyStatus: 'failure', serverError: err.message}); |