mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-26 03:52:50 +02:00
Add support for recaptcha upon signup
This commit is contained in:
parent
e02e47c48e
commit
3ef4e1f6b7
@ -52,6 +52,8 @@ default_config = {
|
||||
'WEBSITE': 'https://mailu.io',
|
||||
'WEB_ADMIN': '/admin',
|
||||
'WEB_WEBMAIL': '/webmail',
|
||||
'RECAPTCHA_PUBLIC_KEY': '',
|
||||
'RECAPTCHA_PRIVATE_KEY': '',
|
||||
# Advanced settings
|
||||
'PASSWORD_SCHEME': 'SHA512-CRYPT',
|
||||
# Host settings
|
||||
|
@ -79,6 +79,7 @@ class UserSignupForm(flask_wtf.FlaskForm):
|
||||
localpart = fields.StringField(_('Email address'), [validators.DataRequired(), validators.Regexp("^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+$")])
|
||||
pw = fields.PasswordField(_('Password'), [validators.DataRequired()])
|
||||
pw2 = fields.PasswordField(_('Confirm password'), [validators.EqualTo('pw')])
|
||||
captcha = flask_wtf.RecaptchaField()
|
||||
submit = fields.SubmitField(_('Sign up'))
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
{% call macros.box() %}
|
||||
{{ macros.form_field(form.localpart, append='<span class="input-group-addon">@'+domain.name+'</span>') }}
|
||||
{{ macros.form_fields((form.pw, form.pw2)) }}
|
||||
{{ macros.form_field(form.captcha) }}
|
||||
{{ macros.form_field(form.submit) }}
|
||||
{% endcall %}
|
||||
</form>
|
||||
|
@ -103,6 +103,10 @@ SITENAME=Mailu
|
||||
# Linked Website URL
|
||||
WEBSITE=https://mailu.io
|
||||
|
||||
# Registration reCaptcha settings (warning, this has some privacy impact)
|
||||
# RECAPTCHA_PUBLIC_KEY=
|
||||
# RECAPTCHA_PRIVATE_KEY=
|
||||
|
||||
###################################
|
||||
# Advanced settings
|
||||
###################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user