Integrate MAS with Synapse

This commit is contained in:
Your Name
2025-12-01 08:14:13 -06:00
parent df07d51d8b
commit a3d39d901b
404 changed files with 22542 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
{#
Copyright 2024, 2025 New Vector Ltd.
Copyright 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" %}
{% block content %}
<header class="page-heading">
<div class="icon invalid">
{{ icon.error_solid() }}
</div>
<div class="header">
<h1 class="title">{{ _("mas.recovery.consumed.heading") }}</h1>
<p class="text">{{ _("mas.recovery.consumed.description") }}</p>
</div>
{{ button.link_outline(text=_("action.start_over"), href="/login") }}
</header>
{% endblock content %}

View File

@@ -0,0 +1,24 @@
{#
Copyright 2024, 2025 New Vector Ltd.
Copyright 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" %}
{% block content %}
<header class="page-heading">
<div class="icon invalid">
{{ icon.lock_solid() }}
</div>
<div class="header">
<h1 class="title">{{ _("mas.recovery.disabled.heading") }}</h1>
<p class="text">{{ _("mas.recovery.disabled.description") }}</p>
</div>
{{ button.link_outline(text=_("action.back"), href="/login") }}
</header>
{% endblock content %}

View File

@@ -0,0 +1,32 @@
{#
Copyright 2024, 2025 New Vector Ltd.
Copyright 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" %}
{% block content %}
<header class="page-heading">
<div class="icon invalid">
{{ icon.error_solid() }}
</div>
<div class="header">
<h1 class="title">{{ _("mas.recovery.expired.heading") }}</h1>
<p class="text [&>span]:font-medium">{{ _("mas.recovery.expired.description", email=session.email) }}</p>
</div>
</header>
<div class="flex flex-col gap-6">
<form class="cpd-form-root" method="POST" action="{{ '/recover/progress/' + session.id | prefix_url }}">
<input type="hidden" name="csrf" value="{{ csrf_token }}" />
{{ button.button(text=_("mas.recovery.expired.resend_email"), type="submit") }}
</form>
{{ button.link_outline(text=_("action.start_over"), href="/login") }}
</div>
{% endblock content %}

View File

@@ -0,0 +1,47 @@
{#
Copyright 2024, 2025 New Vector Ltd.
Copyright 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" %}
{% block content %}
<header class="page-heading">
<div class="icon">
{{ icon.lock_solid() }}
</div>
<div class="header">
<h1 class="title">{{ _("mas.recovery.finish.heading") }}</h1>
<p class="text">{{ _("mas.recovery.finish.description") }}</p>
</div>
</header>
<form class="cpd-form-root" method="POST">
{# Hidden username field so that password manager can save the username #}
<input class="hidden" aria-hidden="true" type="text" name="username" autocomplete="username" value="{{ user.username }}" />
{% if form.errors is not empty %}
{% for error in form.errors %}
<div class="text-critical font-medium">
{{ errors.form_error_message(error=error) }}
</div>
{% endfor %}
{% endif %}
<input type="hidden" name="csrf" value="{{ csrf_token }}" />
{% call(f) field.field(label=_("mas.recovery.finish.new"), name="new_password", form_state=form) %}
<input {{ field.attributes(f) }} class="cpd-text-control" type="password" autofocus autocomplete="new-password" required />
{% endcall %}
{% call(f) field.field(label=_("mas.recovery.finish.confirm"), name="new_password_confirm", form_state=form) %}
<input {{ field.attributes(f) }} class="cpd-text-control" type="password" autocomplete="new-password" required />
{% endcall %}
{{ button.button(text=_("mas.recovery.finish.save_and_continue"), type="submit") }}
</form>
{% endblock content %}

View File

@@ -0,0 +1,37 @@
{#
Copyright 2024, 2025 New Vector Ltd.
Copyright 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" %}
{% block content %}
<header class="page-heading">
<div class="icon">
{{ icon.send_solid() }}
</div>
<div class="header">
<h1 class="title">{{ _("mas.recovery.progress.heading") }}</h1>
<p class="text [&>span]:font-medium">{{ _("mas.recovery.progress.description", email=session.email) }}</p>
</div>
</header>
<div class="flex flex-col gap-6">
{% if resend_failed_due_to_rate_limit | default(false) %}
<div class="text-critical font-medium">
{{ _("mas.errors.rate_limit_exceeded") }}
</div>
{% endif %}
<form class="cpd-form-root" method="POST">
<input type="hidden" name="csrf" value="{{ csrf_token }}" />
{{ button.button_outline(text=_("mas.recovery.progress.resend_email"), type="submit") }}
</form>
{{ button.link_tertiary(text=_("mas.recovery.progress.change_email"), href="/recover") }}
</div>
{% endblock content %}

View File

@@ -0,0 +1,40 @@
{#
Copyright 2024, 2025 New Vector Ltd.
Copyright 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" %}
{% block content %}
<header class="page-heading">
<div class="icon">
{{ icon.email_solid() }}
</div>
<div class="header">
<h1 class="title">{{ _("mas.recovery.start.heading") }}</h1>
<p class="text">{{ _("mas.recovery.start.description") }}</p>
</div>
</header>
<form class="cpd-form-root" method="POST">
{% if form.errors is not empty %}
{% for error in form.errors %}
<div class="text-critical font-medium">
{{ errors.form_error_message(error=error) }}
</div>
{% endfor %}
{% endif %}
<input type="hidden" name="csrf" value="{{ csrf_token }}" />
{% call(f) field.field(label=_("common.email_address"), name="email", form_state=form) %}
<input {{ field.attributes(f) }} class="cpd-text-control" type="email" autocomplete="email" required />
{% endcall %}
{{ button.button(text=_("action.continue"), type="submit") }}
</form>
{% endblock content %}