Files
odoo_source/addons/auth_totp/views/templates.xml
T
Arnaud GonyandMartin Trigaux 2dee29a7dc [IMP] auth_totp: 2FA Trusted Devices
+ Added the 'Trusted Devices' feature
+ Added 'Remember this Device' checkbox on /web/login/totp
+ Added trusted device's OS / browser on Profile > Account Security

Added '2FA Trusted Devices' feature to allow users to remember their
device to bypass the 2FA for the next connections. The trusted devices
are displayed in a 'Trusted Devices' One2Many under the 'Developer API
Keys'. It is possible to revoke all the trusted devices at once with a
special button. It is also possible to revoke one at a time on the
desired one.

Task-id 2523092

closes odoo/odoo#75535

Related: odoo/upgrade#2800
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Martin Trigaux <mat@odoo.com>
2021-09-06 13:17:48 +00:00

51 lines
2.6 KiB
XML

<odoo>
<template id="auth_totp_form" name="Two-Factor Authentication">
<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="">
<div class="mb-2 mt-2 text-muted">
To login, enter below the six-digit authentication code provided by your Authenticator app.
<br/>
<a href="https://www.odoo.com/documentation/15.0/applications/general/auth/2fa.html"
title="Learn More" target="_blank">Learn More</a>
</div>
<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 class="font-weight-bold" for="totp_token">Authentication Code</label>
<input id="totp_token" name="totp_token" class="form-control mb-2"
autocomplete="off" inputmode="numeric" autofocus="autofocus" required="required" placeholder="e.g. 123456"/>
</div>
<div class="text-center py-2 border-top">
<p class="alert alert-danger" t-if="error" role="alert">
<t t-esc="error"/>
</p>
<div class="mb-2 mt-2 text-muted">
<input type="checkbox" name="remember" id="switch-remember" value="1"/>
<label for="switch-remember">Don't ask again on this device</label>
</div>
<div t-attf-class="clearfix oe_login_buttons text-center mb-1">
<button type="submit" class="btn btn-primary btn-block">
Login
</button>
</div>
</div>
</form>
<form method="POST" action="/web/session/logout" class="form-inline">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="w-100 text-center">
<button type="submit" class="btn btn-link btn-sm mb-2">
Cancel
</button>
</div>
</form>
</div>
</t>
</template>
</odoo>