Vulcan/packages/nova-base-components/lib/users/UsersResetPassword.jsx

40 lines
983 B
React
Raw Normal View History

import Telescope 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';
import { Link } from 'react-router';
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) {
return (
<Accounts.ui.LoginForm
formState={ STATES.PASSWORD_CHANGE }
/>
);
}
2016-10-28 21:22:17 -07:00
return (
<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-15 18:33:16 +01:00
UsersResetPassword.propsTypes = {
currentUser: React.PropTypes.object,
params: React.PropTypes.object,
};
2016-11-15 18:33:16 +01:00
Telescope.registerComponent('UsersResetPassword', UsersResetPassword, withCurrentUser);