{# Copyright 2025, 2026 Element Creations Ltd. Copyright 2024, 2025 New Vector Ltd. Copyright 2022-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" %} {% set violation = violations | selectattr("code", "defined") | first | default({}) %} {% set code = violation.code | default("") %} {% block content %} {% set client_display_name = client.client_name or client.client_id %}
{{ icon.error_solid() }}
{% if code == "too-many-sessions" %}

{{ _("mas.policy_violation.too_many_sessions.heading") }}

{{ _("mas.policy_violation.too_many_sessions.description", num_devices_to_remove=violation.need_to_remove) }}

{% elif code == "admin-scope-not-allowed" %}

{{ _("mas.policy_violation.admin_scope_not_allowed.heading") }}

{{ _("mas.policy_violation.admin_scope_not_allowed.description") }}

{% elif code == "client-not-allowed" %}

{{ _("mas.policy_violation.client_not_allowed.heading") }}

{{ _("mas.policy_violation.client_not_allowed.description") }}

{% else %}

{{ _("mas.policy_violation.heading") }}

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

{% endif %}
{% if client.logo_uri %} {% else %} {% endif %} {% if client.client_uri %} {{ client_display_name }} {% else %} {{ client_display_name }} {% endif %}

{{ _("mas.policy_violation.logged_as", username=current_session.user.username) }}

{{ logout.button(text=_("action.sign_out"), csrf_token=csrf_token, post_logout_action=action, as_link=True) }}
{% if code == "too-many-sessions" %} {{ button.link(text=_("mas.policy_violation.too_many_sessions.manage_devices"), href="/account/sessions") }} {% endif %} {# We only show the cancel button if we're in an authorization code flow, not in the device code flow. #} {% if grant.grant_type == "authorization_code" %} {{ back_to_client.link( text=_("action.cancel"), destructive=True, uri=grant.redirect_uri, mode=grant.response_mode, params=dict(error="access_denied", state=grant.state) ) }} {% endif %}
{% endblock content %}