{% extends "tungsten/layout/app.html" %} {% import "tungsten/components/ui.html" as ui %} {% block content %} {% set subheading = 'Protect your account with a code from your phone each time you sign in.' %} {% set breadcrumbs = [(__('Profile'), panel.url('profile')), (__('Two-factor authentication'), None)] %} {% include "tungsten/components/page-header.html" %}
{% if error %}
{{ __(error) }}
{% endif %} {% if app_method %} {% call ui.card() %}
{{ icon('shield-check' if step in ('enabled', 'codes') else 'shield-alert', 'h-6 w-6') }}

{% if email_method %}{% if step in ('enabled', 'codes') %}{{ __('Authenticator app is on') }}{% else %}{{ __('Authenticator app is off') }}{% endif %} {% elif step in ('enabled', 'codes') %}{{ __('Two-factor authentication is on') }}{% else %}{{ __('Two-factor authentication is off') }}{% endif %}

{% if step in ('enabled', 'codes') %}{{ __("You'll be asked for a code from your authenticator app when you sign in.") }}{% if remaining %} You have {{ remaining }} recovery codes left.{% endif %} {% else %}{{ __('Use an app like Google Authenticator, Microsoft Authenticator or 1Password.') }}{% endif %}

{% if step == 'off' %}
{% elif step == 'confirm' %}
  1. {{ __('Scan the QR code with your authenticator app.') }}
  2. {{ __('Or type this key:') }} {{ secret }}
  3. {{ __('Enter the 6-digit code the app shows.') }}
{% endif %} {% if step == 'codes' and codes %}

{{ __('Save these recovery codes') }}

{{ __("Each code works once if you lose your phone. They won't be shown again.") }}

{% endif %} {% if step in ('enabled', 'codes') %}
{% if not required or other_on.app %}{% endif %}
{% endif %} {% endcall %} {% endif %} {% if email_method %} {% call ui.card() %}

{% if email_step == 'enabled' %}{{ __('Email codes are on') }}{% else %}{{ __('Codes by email') }}{% endif %}

{% if email_step == 'enabled' %}{{ __("When you sign in, we'll email a one-time code to :email.", email=masked_email) }} {% else %}{{ __('No app needed: get a one-time code at :email each time you sign in.', email=masked_email) }}{% endif %}

{% if email_step == 'off' %}
{% elif email_step == 'confirm' %}
{% elif not required or other_on.email %}
{% endif %} {% endcall %} {% endif %}
{% endblock %}