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

44 lines
1.1 KiB
React
Raw Normal View History

2017-03-24 10:41:11 +09:00
import { Components, registerComponent, withCurrentUser } from 'meteor/vulcan:core';
2016-10-28 21:22:17 -07:00
import React, { Component } from 'react';
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
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 (
2017-03-24 10:41:11 +09:00
<Components.AccountsLoginForm
formState={ Symbol('PASSWORD_CHANGE') }
/>
);
}
2016-10-28 21:22:17 -07:00
return (
<div className='password-reset-form'>
2017-03-24 10:41:11 +09:00
<div>{this.context.intl.formatMessage({id: 'accounts.info_password_changed'})}!</div>
<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-15 18:33:16 +01:00
UsersResetPassword.propsTypes = {
currentUser: React.PropTypes.object,
params: React.PropTypes.object,
};
2016-11-15 18:33:16 +01:00
UsersResetPassword.displayName = 'UsersResetPassword';
registerComponent('UsersResetPassword', UsersResetPassword, withCurrentUser);