{# Copyright 2021, 2022 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #} {% extends "base.html" %} {% from "components/idp_brand.html" import logo %} {% block content %}
{% if not password_disabled %}
{{ 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 %} {% call(f) field.field(label=_("common.username"), name="username", form_state=form) %} {% endcall %} {% call(f) field.field(label=_("common.password"), name="password", form_state=form) %} {% endcall %} {{ button.button(text=_("action.continue")) }}
{% if not next or next.kind != "link_upstream" %}

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

{% set params = next["params"] | default({}) | to_params(prefix="?") %} {{ button.link_text(text=_("action.create_account"), href="/register" ~ params) }}
{% endif %} {% endif %} {% if providers %} {% if not password_disabled %} {{ field.separator() }} {% endif %} {% 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 providers and password_disabled %}
{{ _("mas.login.no_login_methods") }}
{% endif %} {% if next and next.kind == "continue_authorization_grant" %} {{ back_to_client.link( text=_("action.cancel"), kind="secondary", destructive=True, uri=next.grant.redirect_uri, mode=next.grant.response_mode, params=dict(error="access_denied", state=next.grant.state) ) }} {% endif %}
{% endblock content %}