2016-12-06 18:06:29 +01:00
|
|
|
import { registerComponent } from 'meteor/nova:lib';
|
2016-10-28 21:22:17 -07:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { Accounts, STATES } from 'meteor/std:accounts-ui';
|
2016-11-01 19:38:06 -07:00
|
|
|
import { Link } from 'react-router';
|
2016-11-30 16:58:28 +09:00
|
|
|
import { withCurrentUser } from 'meteor/nova:core';
|
2016-10-28 21:22:17 -07:00
|
|
|
|
|
|
|
class UsersResetPassword extends Component {
|
|
|
|
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 (
|
|
|
|
<Accounts.ui.LoginForm
|
|
|
|
formState={ STATES.PASSWORD_CHANGE }
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-10-28 21:22:17 -07:00
|
|
|
return (
|
2016-11-01 19:38:06 -07:00
|
|
|
<div className='password-reset-form'>
|
|
|
|
<div>{T9n.get('info.passwordChanged')}!</div>
|
|
|
|
<Link to="/">
|
|
|
|
Return Home
|
|
|
|
</Link>
|
|
|
|
</div>
|
2016-10-28 21:22:17 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-01 19:38:06 -07:00
|
|
|
|
2016-11-15 18:33:16 +01:00
|
|
|
UsersResetPassword.propsTypes = {
|
2016-11-17 20:42:16 +01:00
|
|
|
currentUser: React.PropTypes.object,
|
|
|
|
params: React.PropTypes.object,
|
2016-11-01 19:38:06 -07:00
|
|
|
};
|
2016-11-15 18:33:16 +01:00
|
|
|
|
2016-12-06 18:06:29 +01:00
|
|
|
registerComponent('UsersResetPassword', UsersResetPassword, withCurrentUser);
|