mirror of
https://github.com/simple-login/app.git
synced 2024-09-30 05:31:30 +02:00
Merge pull request #181 from developStorm/webauthn-patch-1
Auto activate WebAuthn authentication
This commit is contained in:
commit
4d87df01a3
@ -62,6 +62,10 @@
|
|||||||
$("#btnVerifyKey").click(verifyKey);
|
$("#btnVerifyKey").click(verifyKey);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{% if auto_activate %}
|
||||||
|
<script>$('document').ready(verifyKey());</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ def fido():
|
|||||||
flash("Only user with security key linked should go to this page", "warning")
|
flash("Only user with security key linked should go to this page", "warning")
|
||||||
return redirect(url_for("auth.login"))
|
return redirect(url_for("auth.login"))
|
||||||
|
|
||||||
|
auto_activate = True
|
||||||
fido_token_form = FidoTokenForm()
|
fido_token_form = FidoTokenForm()
|
||||||
|
|
||||||
next_url = request.args.get("next")
|
next_url = request.args.get("next")
|
||||||
@ -69,6 +70,7 @@ def fido():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error(f"An error occurred in WebAuthn verification process: {e}")
|
LOG.error(f"An error occurred in WebAuthn verification process: {e}")
|
||||||
flash("Key verification failed.", "warning")
|
flash("Key verification failed.", "warning")
|
||||||
|
auto_activate = False
|
||||||
else:
|
else:
|
||||||
user.fido_sign_count = new_sign_count
|
user.fido_sign_count = new_sign_count
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
@ -101,4 +103,5 @@ def fido():
|
|||||||
fido_token_form=fido_token_form,
|
fido_token_form=fido_token_form,
|
||||||
webauthn_assertion_options=webauthn_assertion_options,
|
webauthn_assertion_options=webauthn_assertion_options,
|
||||||
enable_otp=user.enable_otp,
|
enable_otp=user.enable_otp,
|
||||||
|
auto_activate=auto_activate,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user