Files
matrix-authentication-service/templates/pages/policy_violation.html
T

80 lines
2.8 KiB
HTML

{#
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 is_too_many_sessions = violations | length == 1 and violations[0].code == "too-many-sessions" %}
{% set num_sessions_need_to_remove = violations[0].need_to_remove if is_too_many_sessions else none %}
{% block content %}
{% set client_display_name = client.client_name or client.client_id %}
<header class="page-heading">
<div class="icon invalid">
{{ icon.error_solid() }}
</div>
{% if is_too_many_sessions %}
<div class="header">
<h1 class="title">{{ _("mas.policy_violation.too_many_sessions.heading") }}</h1>
<p class="text">{{ _("mas.policy_violation.too_many_sessions.description", num_devices_to_remove=num_sessions_need_to_remove) }}</p>
</div>
{% else %}
<div class="header">
<h1 class="title">{{ _("mas.policy_violation.heading") }}</h1>
<p class="text">{{ _("mas.policy_violation.description") }}</p>
</div>
{% endif %}
</header>
<main class="flex flex-col gap-10">
<div class="flex items-center justify-center gap-4">
{% if client.logo_uri %}
<img class="consent-client-icon image" referrerpolicy="no-referrer" src="{{ client.logo_uri }}" />
{% else %}
<div class="consent-client-icon generic">
{{ icon.web_browser() }}
</div>
{% endif %}
{% if client.client_uri %}
<a target="_blank" href="{{ client.client_uri }}" class="cpd-link" data-kind="primary">
{{ client_display_name }}
</a>
{% else %}
{{ client_display_name }}
{% endif %}
</div>
<div class="flex gap-1 justify-center items-center">
<p class="cpd-text-secondary cpd-text-body-md-regular">
{{ _("mas.policy_violation.logged_as", username=current_session.user.username) }}
</p>
{{ logout.button(text=_("action.sign_out"), csrf_token=csrf_token, post_logout_action=action, as_link=True) }}
</div>
<div class="flex flex-col gap-6">
{% if is_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 %}
</div>
</main>
{% endblock content %}