summaryrefslogtreecommitdiff
path: root/addons/auth_totp/views/templates.xml
blob: 100dbbc44521c532b8d54560370a743023cc4cc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<odoo>
    <template id="assets_tests" inherit_id="web.assets_tests">
        <xpath expr="." position="inside">
            <script type="text/javascript" src="/auth_totp/static/tests/totp_flow.js"></script>
        </xpath>
    </template>
    <template id="auth_totp_form">
        <t t-call="web.login_layout">
            <t t-set="disable_footer">1</t>
            <div class="oe_login_form">
                <h5 class="card-title">Two-factor Authentication</h5>
                <form method="POST" action="" class="">
                    <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                    <input type="hidden" name="redirect" t-att-value="redirect"/>
                    <div class="form-group">
                        <label for="totp_token">Authentication Code (6 digits)</label>
                        <input id="totp_token" name="totp_token" class="form-control mb-2"
                               autofocus="autofocus" required="required"/>
                    </div>
                    <p class="alert alert-danger" t-if="error" role="alert">
                        <t t-esc="error"/>
                    </p>
                    <div t-attf-class="clearfix oe_login_buttons text-center mb-1">
                        <button type="submit" class="btn btn-primary btn-block">
                            Verify
                        </button>
                    </div>
                    <div class="small mb-2 mt-2 text-muted">
                        <i class="fa fa-2x fa-mobile pull-left"/>
                        Open the two-factor authentication app on your
                        device to obtain a code and verify your identity
                    </div>
                </form>
            </div>
            <div class="text-center pb-2 border-top">
                <form method="POST" action="/web/session/logout" class="form-inline">
                    <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                    <button type="submit" class="btn btn-link btn-sm mb-2">
                        Cancel
                    </button>
                </form>
            </div>
        </t>
    </template>
</odoo>