{# Copyright 2024, 2025 New Vector Ltd. Copyright 2023, 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. -#} {% set consent_page = true %} {% extends "base.html" %} {% block content %} {% set client_name = client.client_name or client.client_id %} {% set user_agent = grant.user_agent | parse_user_agent() %} {% if grant.state == "pending" %}
{% if client.logo_uri %} {% else %} {% endif %}

{{ _('mas.consent.continue_to', client_name=client_name) }}

{% if user_agent.device_type == "mobile" %} {{ icon.mobile() }} {% elif user_agent.device_type == "tablet" %} {{ icon.web_browser() }} {% elif user_agent.device_type == "pc" %} {{ icon.computer() }} {% else %} {{ icon.unknown_solid() }} {% endif %}
{% if user_agent.model %}
{{ user_agent.model }}
{% endif %} {% if user_agent.os %}
{{ user_agent.os }} {% if user_agent.os_version %} {{ user_agent.os_version }} {% endif %}
{% endif %} {# If we haven't detected a model, it's probably a browser, so show the name #} {% if not user_agent.model and user_agent.name %}
{{ user_agent.name }} {% if user_agent.version %} {{ user_agent.version }} {% endif %}
{% endif %} {# If we couldn't detect anything, show a generic "Device" #} {% if not user_agent.model and not user_agent.name and not user_agent.os %}
{{ _("mas.device_card.generic_device") }}
{% endif %}
{% call(scopes) scope.unsafe_scopes(scopes=grant.scope.split(" ")) %} {% if scopes is not empty %}

{{ _('mas.consent.scope_list_preface', client_name=client_name) }}

{% endif %} {% endcall %} {% set initial -%} {%- if matrix_user.display_name -%} {{- matrix_user.display_name[0] | upper -}} {%- else -%} {{- matrix_user.mxid[1] | upper -}} {%- endif -%} {%- endset %}
{{ initial }}
{{ matrix_user.display_name or current_session.user.username }}
{{ matrix_user.mxid }}
{% call logout.button(csrf_token=csrf_token, post_logout_action=action) %} {% endcall %}
{% elif grant.state == "rejected" %}
{{ icon.block() }}

{{ _("mas.device_consent.denied.heading") }}

{{ _("mas.device_consent.denied.description", client_name=client_name) }}

{% else %}
{{ icon.check() }}

{{ _("mas.device_consent.granted.heading") }}

{{ _("mas.device_consent.granted.description", client_name=client_name) }}

{% endif %} {% endblock content %}