{% extends "account-base.html" %} {% from "ui.html" import csrf_field, action, when, copyable with context %} {% macro password_form(forced=false) -%}
{% if not forced %}

{{ _("Password") }}

{% endif %} {{ csrf_field() }} {% if user.password_hash %}
{% if forced %}

{{ _("The one your administrator gave you.") }}

{% endif %}
{% else %}

{{ _("Your account has no password yet: you sign in with single sign-on.") }}

{% endif %}

{{ _("12 characters minimum.") }}

{% if not forced %}

{{ _("Your other sessions and your personal tokens will be closed.") }}

{% endif %}
{%- endmacro %} {% block forced %}

@{{ user.username }}

{{ _("Choose your password") }}

{{ _("Your account was created with a temporary password. Replace it with your own to access Synaptane.") }}

{{ password_form(forced=true) }}
{{ csrf_field() }}{{ _("Not your account?") }}
{% endblock %} {% block section %} {% if revealed %}

{{ _("Your recovery codes") }}

{{ _("Keep them somewhere safe, apart from your phone (a password manager, a printed sheet). Each one signs you in once if you lose your phone. They will not be shown again.") }}

    {% for code in revealed.split() %}
  1. {{ code }}
  2. {% endfor %}
{{ copyable("recovery-all", revealed.split()|join(" "), block=true) }}
{% endif %} {{ password_form() }}

{{ _("Two-factor authentication") }}

{% if two_factor_on %}

{{ _("On") }} {{ _("Each sign-in with your password also asks for a code from your authenticator app.") }} {{ _("{n} recovery codes left.", n=recovery_left) }}

{% if not two_factor_required %} {% endif %}
{% elif not user.password_hash %}

{{ _("You sign in with single sign-on: your identity provider asks for the second factor.") }}

{% else %}

{{ _("A code from an authenticator app on your phone, asked after your password: a stolen password is no longer enough.") }}

{{ _("Set up two-factor authentication") }} {% endif %}

{{ _("Sessions") }}

{{ _("Browsers signed in to your account. A session ends after {days} days without use, and after {max} days in any case.", days=idle_days, max=max_days) if idle_days else _("Browsers signed in to your account. A session ends after {max} days.", max=max_days) }}

{% for web_session, browser, current in sessions %}

{{ browser or _("Unknown browser") }}

{% if web_session.address %}{{ web_session.address }}{% endif %}{% if current %}{{ _("This session") }}{% endif %}
{{ _("Signed in") }} {{ when(web_session.created_at) }} ยท {{ _("last active") }} {{ when(web_session.last_seen_at) }} {% if not current %}{{ action("/account/sessions/" ~ web_session.id ~ "/close", _("Sign out"), confirm=_("Sign this browser out? It will need your password again."), kind="danger") }}{% endif %}
{% endfor %} {% if sessions|length > 1 %}
{{ action("/account/sessions/close-others", _("Sign out of all other sessions"), confirm=_("Sign out everywhere except this browser?"), kind="danger") }}
{% endif %}
{% if identities or linkable %}

{{ _("Single sign-on identities") }}

{{ _("External accounts you sign in to Synaptane with.") }}

{% for identity, provider in identities %}

{{ provider.name }}

{{ identity.email }}
{% if identity.last_login_at %}{{ _("Last sign-in") }} {{ when(identity.last_login_at) }}{% else %}{{ _("Never used to sign in") }}{% endif %} {{ action("/account/identities/" ~ identity.id ~ "/unlink", _("Unlink"), confirm=_("Unlink this {name} account? You will no longer be able to sign in with it.", name=provider.name), kind="danger") }}
{% endfor %} {% if linkable %} {% endif %}
{% endif %} {% endblock %}