Ghost/ghost/members-auth-pages/pages/ResetPasswordPage.js

21 lines
789 B
JavaScript
Raw Normal View History

import FormHeader from '../components/FormHeader';
import PasswordInput from '../components/PasswordInput';
import FormSubmit from '../components/FormSubmit';
import Form from '../components/Form';
2019-05-07 11:29:07 +03:00
const getTokenData = (frameLocation) => {
const params = new URLSearchParams(frameLocation.query);
const token = params.get('token') || '';
2019-05-07 11:29:07 +03:00
return {token};
};
2019-05-07 11:29:07 +03:00
export default ({error, frameLocation, handleSubmit}) => (
<div className="gm-modal-form">
<FormHeader title="Reset password" error={error} errorText="Unable to reset password" />
<Form includeData={getTokenData(frameLocation)} onSubmit={handleSubmit}>
<PasswordInput bindTo="password" className="single" />
<FormSubmit label="Set password" />
</Form>
</div>
);