2017-03-24 10:41:11 +09:00
|
|
|
import { Components, registerComponent, withCurrentUser } from 'meteor/vulcan:core';
|
2017-05-19 14:42:43 -06:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2016-11-01 19:38:06 -07:00
|
|
|
import { Link } from 'react-router';
|
2017-03-24 10:41:11 +09:00
|
|
|
import { intlShape } from 'react-intl';
|
2016-10-28 21:22:17 -07:00
|
|
|
|
2017-05-19 14:42:43 -06:00
|
|
|
class UsersResetPassword extends PureComponent {
|
2016-10-28 21:22:17 -07:00
|
|
|
componentDidMount() {
|
|
|
|
const token = this.props.params.token;
|
|
|
|
Accounts._loginButtonsSession.set('resetPasswordToken', token);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2016-11-15 18:33:16 +01:00
|
|
|
if (!this.props.currentUser) {
|
2016-11-01 19:38:06 -07:00
|
|
|
return (
|
2017-03-24 10:41:11 +09:00
|
|
|
<Components.AccountsLoginForm
|
|
|
|
formState={ Symbol('PASSWORD_CHANGE') }
|
2016-11-01 19:38:06 -07:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-10-28 21:22:17 -07:00
|
|
|
return (
|
2016-11-01 19:38:06 -07:00
|
|
|
<div className='password-reset-form'>
|
2017-03-24 10:41:11 +09:00
|
|
|
<div>{this.context.intl.formatMessage({id: 'accounts.info_password_changed'})}!</div>
|
2016-11-01 19:38:06 -07:00
|
|
|
<Link to="/">
|
|
|
|
Return Home
|
|
|
|
</Link>
|
|
|
|
</div>
|
2016-10-28 21:22:17 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-24 10:41:11 +09:00
|
|
|
UsersResetPassword.contextTypes = {
|
|
|
|
intl: intlShape
|
|
|
|
}
|
2016-11-01 19:38:06 -07:00
|
|
|
|
2016-11-15 18:33:16 +01:00
|
|
|
UsersResetPassword.propsTypes = {
|
2017-05-19 14:42:43 -06:00
|
|
|
currentUser: PropTypes.object,
|
|
|
|
params: PropTypes.object,
|
2016-11-01 19:38:06 -07:00
|
|
|
};
|
2016-11-15 18:33:16 +01:00
|
|
|
|
2017-01-18 12:51:10 +01:00
|
|
|
UsersResetPassword.displayName = 'UsersResetPassword';
|
|
|
|
|
2016-12-06 18:06:29 +01:00
|
|
|
registerComponent('UsersResetPassword', UsersResetPassword, withCurrentUser);
|