mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-02-06 17:05:56 +05:30
Попытка сделать frontend для отображения капчи на странице запроса восстановления пароля
This commit is contained in:
parent
258c0a7a5f
commit
c1e9cdc6b9
@ -81,10 +81,11 @@ export function acceptRules() {
|
||||
}
|
||||
|
||||
export function forgotPassword({
|
||||
login = ''
|
||||
login = '',
|
||||
captcha = ''
|
||||
}) {
|
||||
return wrapInLoader((dispatch, getState) =>
|
||||
authentication.forgotPassword({login})
|
||||
authentication.forgotPassword({login, captcha})
|
||||
.then(({data = {}}) => dispatch(updateUser({
|
||||
maskedEmail: data.emailMask || getState().user.email
|
||||
})))
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
|
||||
import { Input } from 'components/ui/form';
|
||||
import { Input, Captcha } from 'components/ui/form';
|
||||
import icons from 'components/ui/icons.scss';
|
||||
import BaseAuthBody from 'components/auth/BaseAuthBody';
|
||||
|
||||
@ -57,6 +57,8 @@ export default class ForgotPasswordBody extends BaseAuthBody {
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Captcha {...this.bindField('captcha')} delay={600} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -28,11 +28,12 @@ const authentication = {
|
||||
},
|
||||
|
||||
forgotPassword({
|
||||
login = ''
|
||||
login = '',
|
||||
captcha = ''
|
||||
}) {
|
||||
return request.post(
|
||||
'/api/authentication/forgot-password',
|
||||
{login},
|
||||
{login, captcha},
|
||||
{token: null}
|
||||
);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user