Add a configuration option to make email optional for password registration

This commit is contained in:
Quentin Gliech
2025-10-07 17:13:05 +02:00
parent 138f1b1a42
commit 28e573b400
18 changed files with 482 additions and 97 deletions

View File

@@ -41,7 +41,11 @@ Please see LICENSE files in the repository root for full details.
{% endfor %}
{% if features.password_registration %}
{{ button.button(text=_("mas.register.continue_with_email")) }}
{% if features.password_registration_email_required %}
{{ button.button(text=_("mas.register.continue_with_email")) }}
{% else %}
{{ button.button(text=_("mas.register.continue_with_password")) }}
{% endif %}
{% endif %}
{% if providers %}

View File

@@ -35,9 +35,11 @@ Please see LICENSE files in the repository root for full details.
<input {{ field.attributes(f) }} class="cpd-text-control" type="text" autocomplete="username" autocorrect="off" autocapitalize="none" required />
{% endcall %}
{% call(f) field.field(label=_("common.email_address"), name="email", form_state=form) %}
<input {{ field.attributes(f) }} class="cpd-text-control" type="email" autocomplete="email" required />
{% endcall %}
{% if features.password_registration_email_required %}
{% call(f) field.field(label=_("common.email_address"), name="email", form_state=form) %}
<input {{ field.attributes(f) }} class="cpd-text-control" type="email" autocomplete="email" required />
{% endcall %}
{% endif %}
{% call(f) field.field(label=_("common.password"), name="password", form_state=form) %}
<input {{ field.attributes(f) }} class="cpd-text-control" type="password" autocomplete="new-password" required />