mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 20:51:29 +02:00
Allow to use either OTP or FIDO for 2FA
This commit is contained in:
parent
650d6e35f0
commit
9da6054ec0
@ -26,6 +26,12 @@
|
||||
<button id="btnVerifyKey" class="btn btn-success mt-2">Use your security key</button>
|
||||
</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>
|
||||
async function verifyKey () {
|
||||
$("#btnVerifyKey").prop('disabled', true);
|
||||
|
@ -28,6 +28,12 @@
|
||||
<button class="btn btn-success mt-2">Validate</button>
|
||||
</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>
|
||||
|
||||
{% endblock %}
|
@ -102,4 +102,5 @@ def fido():
|
||||
webauthn_assertion_options = webauthn_assertion_options.assertion_dict
|
||||
|
||||
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:
|
||||
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 New Issue
Block a user