<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

    <t t-name="auth_timeout.CheckIdentityDialog">
        <Dialog title.translate="Confirm access" size="'md'" contentClass="'o_error_dialog'" footer="false">
            <CheckIdentityForm t-props="formProps"/>
        </Dialog>
    </t>

    <t t-name="auth_timeout.CheckIdentityForm">
        <p role="alert" class="alert alert-danger" t-if="state.error" t-esc="state.error"/>
        <div class="text-center border rounded mb-3 p-3">
            <img t-attf-src="/web/image/res.users/{{user.userId}}/avatar_128" class="o_avatar rounded me-1"/>
            Signed in as <strong t-out="user.name"/>
        </div>
        <div class="border rounded mb-3 p-3 bg-light">
            <form t-att-id="state.authMethod" t-on-submit.prevent="onSubmit" class="o_check_identity_form">
                <input type="hidden" name="type" t-att-value="state.authMethod"/>
                <t t-call="{{ getAuthMethodFormTemplate(state.authMethod) }}"/>
            </form>
        </div>
        <div t-if="authMethods.length > 1" class="border rounded mb-3 p-3">
            <h6>Having problems ?</h6>
            <ul>
                <t t-foreach="authMethods" t-as="authMethod" t-key="authMethod_index">
                    <li t-if="state.authMethod !== authMethod">
                        <a href="#" t-on-click="onChangeAuthMethod" t-att-data-auth-method="authMethod">
                            <t t-call="{{ getAuthMethodLinkStringTemplate(authMethod) }}"/>
                        </a>
                    </li>
                </t>
            </ul>
        </div>
    </t>

    <!-- Password -->
    <t t-name="auth_timeout.CheckIdentityFormPassword">
        <input name="password" type="password" class="form-control" placeholder="Password"/>
        <div class="text-end mb-3">
            <a href="/web/reset_password">Forgot password?</a>
        </div>
        <div class="text-center d-grid">
            <button type="submit" class="btn btn-primary">Confirm</button>
        </div>
    </t>
    <t t-name="auth_timeout.CheckIdentityLinkStringPassword">Use your password</t>

    <!-- TOTP Mail -->
    <t t-name="auth_timeout.CheckIdentityFormTOTPMail">
        <div class="text-center">
            <i class="fa fa-3x fa-envelope" aria-hidden="true"/>
            <h3>Authentication code via email</h3>
        </div>
        <div>
            Enter below the six-digit authentication code just sent to your email
        </div>
        <input name="token" inputmode="numeric" pattern="[0-9]+" class="form-control" placeholder="XXXXXX"/>
        <div class="text-center gap-1 d-grid mb-1 pt-3">
            <button type="submit" class="btn btn-primary">Verify</button>
        </div>
    </t>
    <t t-name="auth_timeout.CheckIdentityLinkStringTOTPMail">Use an authentication code sent by email</t>

    <!-- TOTP App -->
    <t t-name="auth_timeout.CheckIdentityFormTOTP">
        <div class="text-center">
            <i class="fa fa-3x fa-mobile" aria-hidden="true"/>
            <h3>Authentication code</h3>
        </div>
        <input name="token" inputmode="numeric" pattern="[0-9]+" class="form-control" placeholder="XXXXXX"/>
        <div class="text-center gap-1 d-grid mb-1 pt-3">
            <button type="submit" class="btn btn-primary">Verify</button>
        </div>
        <div>
            Open your two-factor authenticator (TOTP) app or browser extension to view your authentication code.
        </div>
    </t>
    <t t-name="auth_timeout.CheckIdentityLinkStringTOTP">Use your authenticator app</t>

    <!-- Passkey -->
    <t t-name="auth_timeout.CheckIdentityFormWebAuthN">
        <input type="hidden" name="webauthn_response"/>
        <div class="text-center">
            <i class="fa fa-3x fa-shield" aria-hidden="true"/>
            <h3>Passkey</h3>
        </div>
        <div>
            When you are ready, authenticate using the button below.
        </div>
        <div class="text-center gap-1 d-grid mb-1 pt-3">
            <button type="submit" class="btn btn-primary">Use passkey</button>
        </div>
    </t>
    <t t-name="auth_timeout.CheckIdentityLinkStringWebAuthN">Use your passkey</t>

</templates>
