2026-04-30 08:54:55 -04:00
|
|
|
{% extends "_layout.html.j2" %}
|
|
|
|
|
|
|
|
|
|
{%- block head -%}
|
|
|
|
|
<link rel="stylesheet" href="{{ crate::ROUTE_PREFIX }}/resources/grant.css">
|
|
|
|
|
{%- endblock -%}
|
|
|
|
|
|
|
|
|
|
{%- block title -%}
|
|
|
|
|
Authorize client
|
|
|
|
|
{%- endblock -%}
|
|
|
|
|
|
|
|
|
|
{%- block content -%}
|
2026-07-12 17:32:13 -04:00
|
|
|
{% let client_name = client_metadata.client_name.as_deref().unwrap_or("Unknown application") %}
|
2026-04-30 08:54:55 -04:00
|
|
|
<div class="panel narrow">
|
|
|
|
|
<h1>Authorize {{ client_name }}</h1>
|
|
|
|
|
<div class="avatars">
|
|
|
|
|
<div class="red-avatar">
|
|
|
|
|
{{ user_avatar }}
|
|
|
|
|
</div>
|
2026-06-09 10:05:44 -04:00
|
|
|
<div class="separator" aria-hidden="true">
|
2026-04-30 08:54:55 -04:00
|
|
|
⇄
|
|
|
|
|
</div>
|
2026-07-12 17:32:13 -04:00
|
|
|
{{ Avatar::for_client(client_metadata) }}
|
2026-04-30 08:54:55 -04:00
|
|
|
</div>
|
2026-08-26 14:12:40 -04:00
|
|
|
|
2026-04-30 08:54:55 -04:00
|
|
|
<div class="identity">
|
|
|
|
|
Signed in as <code>{{ user_id }}</code>. <a href="{{ crate::ROUTE_PREFIX }}/account/logout?{{ logout_query }}">Switch accounts</a>
|
|
|
|
|
</div>
|
2026-08-26 14:12:40 -04:00
|
|
|
|
2026-04-30 08:54:55 -04:00
|
|
|
<p>
|
2026-07-12 17:32:13 -04:00
|
|
|
<b>{{ client_name }}</b> (<a href="{{ client_metadata.client_uri }}">{{ client_metadata.client_uri.domain().unwrap() }}</a>) would like
|
2026-04-30 08:54:55 -04:00
|
|
|
your permission to:
|
2026-08-26 14:12:40 -04:00
|
|
|
|
2026-04-30 14:55:21 -04:00
|
|
|
{{ scopes }}
|
2026-04-30 08:54:55 -04:00
|
|
|
</p>
|
2026-08-26 14:12:40 -04:00
|
|
|
|
|
|
|
|
{% if scopes.scopes.contains(&OAuthClientScope::ServerAdministration) %}
|
|
|
|
|
<p class="card danger">
|
|
|
|
|
⚠️ {{ client_name }} wants to be able to administrate your homeserver. If it is untrustworthy,
|
|
|
|
|
it could use its administrator powers to cause severe damage to your homeserver's users and rooms.
|
|
|
|
|
Make sure you trust it fully before you continue.
|
|
|
|
|
</p>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2026-07-12 17:32:13 -04:00
|
|
|
{% match (&client_metadata.policy_uri, &client_metadata.tos_uri) %}
|
2026-04-30 08:54:55 -04:00
|
|
|
{% when (Some(policy_uri), Some(tos_uri)) %}
|
|
|
|
|
<p>
|
|
|
|
|
{{ client_name }}'s <a href="{{ policy_uri }}">policies</a>
|
|
|
|
|
and <a href="{{ tos_uri }}">terms of service</a> apply.
|
|
|
|
|
</p>
|
|
|
|
|
{% when (Some(policy_uri), None) %}
|
|
|
|
|
<p>
|
|
|
|
|
{{ client_name }}'s <a href="{{ policy_uri }}">policies</a> apply.
|
|
|
|
|
</p>
|
|
|
|
|
{% when (None, Some(tos_uri)) %}
|
|
|
|
|
<p>
|
|
|
|
|
{{ client_name }}'s <a href="{{ tos_uri }}">terms of service</a> apply.
|
|
|
|
|
</p>
|
|
|
|
|
{% when (None, None) %}
|
|
|
|
|
<p>
|
|
|
|
|
Make sure you trust {{ client_name }} with access to your data.
|
|
|
|
|
</p>
|
|
|
|
|
{% endmatch %}
|
|
|
|
|
|
|
|
|
|
<form method="post">
|
2026-07-12 17:32:13 -04:00
|
|
|
<input type="hidden" name="stage" value="confirm">
|
|
|
|
|
{% if let Some(device_code) = device_code %}
|
|
|
|
|
<input type="hidden" name="device_code" value="{{ device_code }}">
|
|
|
|
|
{% endif %}
|
2026-04-30 08:54:55 -04:00
|
|
|
<button type="submit">Continue</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
{%- endblock -%}
|