mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
import { Components, registerComponent, withCurrentUser } from 'meteor/vulcan:core';
|
|
import React, { PureComponent } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { intlShape } from 'meteor/vulcan:i18n';
|
|
import { STATES } from '../../helpers.js';
|
|
|
|
class AccountsEnrollAccount extends PureComponent {
|
|
componentDidMount() {
|
|
const token = this.props.params.token;
|
|
Accounts._loginButtonsSession.set('enrollAccountToken', token);
|
|
}
|
|
|
|
render() {
|
|
if (!this.props.currentUser) {
|
|
return (
|
|
<Components.AccountsLoginForm
|
|
formState={ STATES.ENROLL_ACCOUNT }
|
|
/>
|
|
);
|
|
} else {
|
|
return (
|
|
<div className='password-reset-form'>
|
|
<div>{this.context.intl.formatMessage({id: 'accounts.info_password_changed'})}!</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
AccountsEnrollAccount.contextTypes = {
|
|
intl: intlShape
|
|
}
|
|
|
|
AccountsEnrollAccount.propsTypes = {
|
|
currentUser: PropTypes.object,
|
|
params: PropTypes.object,
|
|
};
|
|
|
|
AccountsEnrollAccount.displayName = 'AccountsEnrollAccount';
|
|
|
|
registerComponent('AccountsEnrollAccount', AccountsEnrollAccount, withCurrentUser);
|