diff --git a/approval_polls/settings.py b/approval_polls/settings.py index 8bdb131..ccc6cab 100644 --- a/approval_polls/settings.py +++ b/approval_polls/settings.py @@ -203,7 +203,13 @@ "django.contrib.auth.backends.ModelBackend", "passkeys.backend.PasskeyModelBackend", ] # Change your authentication backend + FIDO_SERVER_ID = "vote.electionscience.org" # Server rp id for FIDO2, it the full domain of your project FIDO_SERVER_NAME = "vote.electionscience.org" +if DEBUG: + FIDO_SERVER_ID = ( + "localhost" # Server rp id for FIDO2, it the full domain of your project + ) + FIDO_SERVER_NAME = "localhost" KEY_ATTACHMENT = None diff --git a/approval_polls/templates/registration/login.html b/approval_polls/templates/registration/login.html index 16fe652..eff602d 100644 --- a/approval_polls/templates/registration/login.html +++ b/approval_polls/templates/registration/login.html @@ -6,14 +6,12 @@
- {% if form.errors %} - - {% endif %} + {% if invalid %}
Invalid Username or password
{% endif %}
Login
{% csrf_token %} {% if invalid %}{% endif %} @@ -36,8 +34,8 @@ placeholder="Password">
-
+ + {% include 'passkeys.js' %}
Need an account? Register @@ -52,7 +51,6 @@ - {% include 'passkeys.js' %}