mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-31 01:10:51 +05:30
#14: add captcha for register page
This commit is contained in:
parent
32c333d159
commit
a8d72787b2
@ -71,13 +71,15 @@ export function register({
|
|||||||
username = '',
|
username = '',
|
||||||
password = '',
|
password = '',
|
||||||
rePassword = '',
|
rePassword = '',
|
||||||
|
captcha = '',
|
||||||
rulesAgreement = false
|
rulesAgreement = false
|
||||||
}) {
|
}) {
|
||||||
return wrapInLoader((dispatch, getState) =>
|
return wrapInLoader((dispatch, getState) =>
|
||||||
signup.register({
|
signup.register({
|
||||||
email, username,
|
email, username,
|
||||||
password, rePassword,
|
password, rePassword,
|
||||||
rulesAgreement, lang: getState().user.lang
|
rulesAgreement, lang: getState().user.lang,
|
||||||
|
captcha
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
dispatch(updateUser({
|
dispatch(updateUser({
|
||||||
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import { FormattedMessage as Message } from 'react-intl';
|
import { FormattedMessage as Message } from 'react-intl';
|
||||||
import { Link } from 'react-router';
|
import { Link } from 'react-router';
|
||||||
|
|
||||||
import { Input, Checkbox } from 'components/ui/form';
|
import { Input, Checkbox, Captcha } from 'components/ui/form';
|
||||||
import BaseAuthBody from 'components/auth/BaseAuthBody';
|
import BaseAuthBody from 'components/auth/BaseAuthBody';
|
||||||
import passwordMessages from 'components/auth/password/Password.intl.json';
|
import passwordMessages from 'components/auth/password/Password.intl.json';
|
||||||
|
|
||||||
@ -54,6 +54,8 @@ export default class RegisterBody extends BaseAuthBody {
|
|||||||
placeholder={messages.repeatPassword}
|
placeholder={messages.repeatPassword}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Captcha {...this.bindField('captcha')} />
|
||||||
|
|
||||||
<Checkbox {...this.bindField('rulesAgreement')}
|
<Checkbox {...this.bindField('rulesAgreement')}
|
||||||
color="blue"
|
color="blue"
|
||||||
required
|
required
|
||||||
|
@ -7,11 +7,12 @@ export default {
|
|||||||
password = '',
|
password = '',
|
||||||
rePassword = '',
|
rePassword = '',
|
||||||
rulesAgreement = false,
|
rulesAgreement = false,
|
||||||
lang = ''
|
lang = '',
|
||||||
|
captcha = ''
|
||||||
}) {
|
}) {
|
||||||
return request.post(
|
return request.post(
|
||||||
'/api/signup',
|
'/api/signup',
|
||||||
{email, username, password, rePassword, rulesAgreement, lang}
|
{email, username, password, rePassword, rulesAgreement, lang, captcha}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user