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