2019-12-27 15:22:58 +01:00
|
|
|
{% extends 'default.html' %}
|
2019-12-29 15:10:40 +01:00
|
|
|
{% set active_page = "setting" %}
|
2019-12-27 15:22:58 +01:00
|
|
|
{% block title %}
|
|
|
|
MFA Setup
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block head %}
|
2020-02-04 10:53:25 +01:00
|
|
|
<script src="{{ url_for('static', filename='node_modules/qrious/dist/qrious.min.js') }}"></script>
|
2019-12-27 15:22:58 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block default_content %}
|
2020-05-11 23:22:06 +02:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
2020-08-05 12:30:56 +02:00
|
|
|
<h1 class="h3">Two Factor Authentication - TOTP</h1>
|
2020-05-29 14:51:56 +02:00
|
|
|
<p>You will need to use a 2FA application like Google Authenticator or Authy on your phone or PC and scan the following QR Code:
|
2020-05-11 23:22:06 +02:00
|
|
|
</p>
|
2019-12-27 15:22:58 +01:00
|
|
|
|
2020-05-11 23:22:06 +02:00
|
|
|
<canvas id="qr"></canvas>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
(function () {
|
|
|
|
var qr = new QRious({
|
|
|
|
element: document.getElementById('qr'),
|
|
|
|
value: '{{otp_uri}}'
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
</script>
|
2019-12-27 15:22:58 +01:00
|
|
|
|
2020-05-11 23:22:06 +02:00
|
|
|
<div class="mt-3 mb-2">
|
2020-05-29 14:51:56 +02:00
|
|
|
Or you can manually enter the following secret key:
|
2020-05-11 23:22:06 +02:00
|
|
|
</div>
|
2019-12-27 15:22:58 +01:00
|
|
|
|
2020-05-11 23:22:06 +02:00
|
|
|
<input class="form-control" disabled value="{{ current_user.otp_secret }}">
|
2019-12-27 15:22:58 +01:00
|
|
|
|
|
|
|
|
2020-05-11 23:22:06 +02:00
|
|
|
<form method="post">
|
|
|
|
{{ otp_token_form.csrf_token }}
|
2019-12-27 15:22:58 +01:00
|
|
|
|
2020-05-11 23:22:06 +02:00
|
|
|
<div class="font-weight-bold mt-5">Token</div>
|
2020-05-29 14:51:56 +02:00
|
|
|
<div class="small-text">Please enter the 6-digit number displayed in your authenticator app.</div>
|
2019-12-27 15:22:58 +01:00
|
|
|
|
2020-05-11 23:22:06 +02:00
|
|
|
{{ otp_token_form.token(class="form-control", placeholder="") }}
|
|
|
|
{{ render_field_errors(otp_token_form.token) }}
|
2020-05-29 14:51:56 +02:00
|
|
|
<button class="btn btn-lg btn-success mt-2">Submit</button>
|
2020-05-11 23:22:06 +02:00
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
2019-12-27 15:22:58 +01:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|