stages/authenticator_validate: fix passwordless flows not working
closes #2484 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
a77616e942
commit
ceb894039e
3
Makefile
3
Makefile
|
@ -137,7 +137,6 @@ install:
|
|||
cd website && npm i
|
||||
|
||||
a: install
|
||||
tmux \
|
||||
tmux -CC \
|
||||
new-session 'make run' \; \
|
||||
split-window 'make web-watch'
|
||||
# detach-client
|
||||
|
|
|
@ -291,7 +291,7 @@ class Application(PolicyBindingModel):
|
|||
url = self.meta_launch_url
|
||||
if provider := self.get_provider():
|
||||
url = provider.launch_url
|
||||
if user:
|
||||
if user and url:
|
||||
if isinstance(user, SimpleLazyObject):
|
||||
user._setup()
|
||||
user = user._wrapped
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"""Authenticator Validation"""
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django_otp import devices_for_user
|
||||
from rest_framework.fields import CharField, IntegerField, JSONField, ListField, UUIDField
|
||||
|
@ -279,7 +280,7 @@ class AuthenticatorValidateStageView(ChallengeStageView):
|
|||
def challenge_valid(self, response: AuthenticatorValidationChallengeResponse) -> HttpResponse:
|
||||
# All validation is done by the serializer
|
||||
user = self.executor.plan.context.get(PLAN_CONTEXT_PENDING_USER)
|
||||
if not user:
|
||||
if not user or isinstance(user, AnonymousUser):
|
||||
webauthn_device: WebAuthnDevice = response.data.get("webauthn", None)
|
||||
if not webauthn_device:
|
||||
return self.executor.stage_ok()
|
||||
|
|
Reference in New Issue