Integrate postnumber resolver across MAS flows
This commit is contained in:
@@ -40,6 +40,8 @@ Please see LICENSE files in the repository root for full details.
|
||||
{{ _("mas.errors.username_banned") }}
|
||||
{% elif error.code == "username-not-allowed" %}
|
||||
{{ _("mas.errors.username_not_allowed") }}
|
||||
{% elif error.code == "postnumber-reserved" %}
|
||||
{{ _("mas.errors.postnumber_reserved") }}
|
||||
{% elif error.code == "email-domain-not-allowed" %}
|
||||
{{ _("mas.errors.email_domain_not_allowed") }}
|
||||
{% elif error.code == "email-domain-banned" %}
|
||||
|
||||
@@ -12,7 +12,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
{% from "components/idp_brand.html" import logo %}
|
||||
|
||||
{% block content %}
|
||||
<form method="GET" class="flex flex-col gap-10" action="{{ '/register/password' | prefix_url }}">
|
||||
<form method="POST" class="flex flex-col gap-10" action="{{ '/register' | prefix_url }}">
|
||||
<header class="page-heading">
|
||||
<div class="brand-logo">
|
||||
{{ brand_logo.letro_logo() }}
|
||||
@@ -28,8 +28,12 @@ Please see LICENSE files in the repository root for full details.
|
||||
</header>
|
||||
|
||||
{% if features.password_registration %}
|
||||
<input type="hidden" name="csrf" value="{{ csrf_token }}" />
|
||||
|
||||
{% call(f) field.field(label=_("common.username"), name="username", form_state=form) %}
|
||||
<input {{ field.attributes(f) }} class="cpd-text-control" type="text" autocomplete="username" autocorrect="off" autocapitalize="off" data-choose-username />
|
||||
{{ field.error(error={"kind": "policy", "code": "username-invalid-chars"}, hidden=true) }}
|
||||
{{ field.error(error={"kind": "policy", "code": "postnumber-reserved"}, hidden=true) }}
|
||||
<div class="cpd-form-message cpd-form-help-message" id="{{ f.id }}-help">
|
||||
@username:{{ branding.server_name }}
|
||||
</div>
|
||||
@@ -37,6 +41,12 @@ Please see LICENSE files in the repository root for full details.
|
||||
{% endif %}
|
||||
|
||||
<div class="cpd-form-root">
|
||||
{% for error in form.errors %}
|
||||
<div class="text-critical font-medium">
|
||||
{{ errors.form_error_message(error=error) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% for key, value in next["params"] | default({}) | items %}
|
||||
<input type="hidden" name="{{ key }}" value="{{ value }}" />
|
||||
{% endfor %}
|
||||
|
||||
@@ -36,6 +36,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
{% call(f) field.field(label=_("common.username"), name="username", form_state=form) %}
|
||||
<input {{ field.attributes(f) }} class="cpd-text-control" type="text" autocomplete="username" autocorrect="off" autocapitalize="none" required data-choose-username />
|
||||
{{ field.error(error={"kind": "policy", "code": "username-invalid-chars"}, hidden=true) }}
|
||||
{{ field.error(error={"kind": "policy", "code": "postnumber-reserved"}, hidden=true) }}
|
||||
{% endcall %}
|
||||
|
||||
{% if features.password_registration_email_required %}
|
||||
|
||||
@@ -102,6 +102,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
{% call(f) field.field(label=_("common.username"), name="username", form_state=form_state) %}
|
||||
<input {{ field.attributes(f) }} class="cpd-text-control" type="text" autocomplete="username" autocorrect="off" autocapitalize="none" value="{{ imported_localpart or '' }}" aria-describedby="{{ f.id }}-help" data-choose-username />
|
||||
{{ field.error(error={"kind": "policy", "code": "username-invalid-chars"}, hidden=true) }}
|
||||
{{ field.error(error={"kind": "policy", "code": "postnumber-reserved"}, hidden=true) }}
|
||||
|
||||
{% if f.errors is empty %}
|
||||
<div class="cpd-form-message cpd-form-help-message" id="{{ f.id }}-help">
|
||||
|
||||
Reference in New Issue
Block a user