mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 17:08:30 +01:00
Allow to use either OTP or FIDO for 2FA
This commit is contained in:
parent
650d6e35f0
commit
9da6054ec0
4 changed files with 15 additions and 2 deletions
|
@ -26,6 +26,12 @@
|
||||||
<button id="btnVerifyKey" class="btn btn-success mt-2">Use your security key</button>
|
<button id="btnVerifyKey" class="btn btn-success mt-2">Use your security key</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if enable_otp %}
|
||||||
|
<div class="text-center text-muted mb-6" style="margin-top: 1em;">
|
||||||
|
Don't have your key with you? <br> <a href="{{ url_for('auth.mfa') }}">Verify by One-Time Password</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
async function verifyKey () {
|
async function verifyKey () {
|
||||||
$("#btnVerifyKey").prop('disabled', true);
|
$("#btnVerifyKey").prop('disabled', true);
|
||||||
|
|
|
@ -28,6 +28,12 @@
|
||||||
<button class="btn btn-success mt-2">Validate</button>
|
<button class="btn btn-success mt-2">Validate</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
{% if enable_fido %}
|
||||||
|
<div class="text-center text-muted mb-6" style="margin-top: 1em;">
|
||||||
|
Having trouble with your authenticator? <br> <a href="{{ url_for('auth.fido') }}">Verify by your security key</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -102,4 +102,5 @@ def fido():
|
||||||
webauthn_assertion_options = webauthn_assertion_options.assertion_dict
|
webauthn_assertion_options = webauthn_assertion_options.assertion_dict
|
||||||
|
|
||||||
return render_template("auth/fido.html", fido_token_form=fido_token_form,
|
return render_template("auth/fido.html", fido_token_form=fido_token_form,
|
||||||
webauthn_assertion_options=webauthn_assertion_options)
|
webauthn_assertion_options=webauthn_assertion_options,
|
||||||
|
enable_otp=user.enable_otp)
|
|
@ -55,4 +55,4 @@ def mfa():
|
||||||
else:
|
else:
|
||||||
flash("Incorrect token", "warning")
|
flash("Incorrect token", "warning")
|
||||||
|
|
||||||
return render_template("auth/mfa.html", otp_token_form=otp_token_form)
|
return render_template("auth/mfa.html", otp_token_form=otp_token_form, enable_fido=(user.fido_uuid is not None))
|
||||||
|
|
Loading…
Reference in a new issue