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 = '',
|
||||
password = '',
|
||||
rePassword = '',
|
||||
captcha = '',
|
||||
rulesAgreement = false
|
||||
}) {
|
||||
return wrapInLoader((dispatch, getState) =>
|
||||
signup.register({
|
||||
email, username,
|
||||
password, rePassword,
|
||||
rulesAgreement, lang: getState().user.lang
|
||||
rulesAgreement, lang: getState().user.lang,
|
||||
captcha
|
||||
})
|
||||
.then(() => {
|
||||
dispatch(updateUser({
|
||||
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
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 passwordMessages from 'components/auth/password/Password.intl.json';
|
||||
|
||||
@ -54,6 +54,8 @@ export default class RegisterBody extends BaseAuthBody {
|
||||
placeholder={messages.repeatPassword}
|
||||
/>
|
||||
|
||||
<Captcha {...this.bindField('captcha')} />
|
||||
|
||||
<Checkbox {...this.bindField('rulesAgreement')}
|
||||
color="blue"
|
||||
required
|
||||
|
@ -7,11 +7,12 @@ export default {
|
||||
password = '',
|
||||
rePassword = '',
|
||||
rulesAgreement = false,
|
||||
lang = ''
|
||||
lang = '',
|
||||
captcha = ''
|
||||
}) {
|
||||
return request.post(
|
||||
'/api/signup',
|
||||
{email, username, password, rePassword, rulesAgreement, lang}
|
||||
{email, username, password, rePassword, rulesAgreement, lang, captcha}
|
||||
);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user