{# Copyright 2024, 2025 New Vector Ltd. Copyright 2021-2024 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. -#} {% extends "base.html" %} {% from "components/idp_brand.html" import logo %} {% block content %}
{{ icon.user_profile_solid() }}
{% if next and next.kind == "link_upstream" %}

{{ _("mas.login.link.headline") }}

{% set name = provider.human_name or (provider.issuer | simplify_url(keep_path=True)) or provider.id %}

{{ _("mas.login.link.description", provider=name) }}

{% else %}

{{ _("mas.login.headline") }}

{{ _("mas.login.description") }}

{% endif %}
{% if form.errors is not empty %} {% for error in form.errors %}
{{ errors.form_error_message(error=error) }}
{% endfor %} {% endif %} {% if features.login_with_email_allowed %} {% call(f) field.field(label=_("mas.login.username_or_email"), name="username", form_state=form) %} {% endcall %} {% else %} {% call(f) field.field(label=_("common.username"), name="username", form_state=form) %} {% endcall %} {% endif %} {% if features.password_login %} {% call(f) field.field(label=_("common.password"), name="password", form_state=form) %} {% endcall %} {% if features.account_recovery %} {{ button.link_text(text=_("mas.login.forgot_password"), href="/recover", class="self-center") }} {% endif %} {% endif %}
{% if features.password_login %} {{ button.button(text=_("action.continue")) }} {% endif %} {% if features.password_login and providers %} {{ field.separator() }} {% endif %} {% if providers %} {% set params = next["params"] | default({}) | to_params(prefix="?") %} {% for provider in providers %} {% set name = provider.human_name or (provider.issuer | simplify_url(keep_path=True)) or provider.id %} {{ logo(provider.brand_name) }} {{ _("mas.login.continue_with_provider", provider=name) }} {% endfor %} {% endif %}
{% if (not next or next.kind != "link_upstream") and features.password_registration %}

{{ _("mas.login.call_to_register") }}

{% set params = next["params"] | default({}) | to_params(prefix="?") %} {{ button.link_text(text=_("action.create_account"), href="/register" ~ params) }}
{% endif %} {% if not providers and not features.password_login %}
{{ _("mas.login.no_login_methods") }}
{% endif %}
{% endblock content %}