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
|
cd website && npm i
|
||||||
|
|
||||||
a: install
|
a: install
|
||||||
tmux \
|
tmux -CC \
|
||||||
new-session 'make run' \; \
|
new-session 'make run' \; \
|
||||||
split-window 'make web-watch'
|
split-window 'make web-watch'
|
||||||
# detach-client
|
|
||||||
|
|
|
@ -291,7 +291,7 @@ class Application(PolicyBindingModel):
|
||||||
url = self.meta_launch_url
|
url = self.meta_launch_url
|
||||||
if provider := self.get_provider():
|
if provider := self.get_provider():
|
||||||
url = provider.launch_url
|
url = provider.launch_url
|
||||||
if user:
|
if user and url:
|
||||||
if isinstance(user, SimpleLazyObject):
|
if isinstance(user, SimpleLazyObject):
|
||||||
user._setup()
|
user._setup()
|
||||||
user = user._wrapped
|
user = user._wrapped
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
"""Authenticator Validation"""
|
"""Authenticator Validation"""
|
||||||
|
from django.contrib.auth.models import AnonymousUser
|
||||||
from django.http import HttpRequest, HttpResponse
|
from django.http import HttpRequest, HttpResponse
|
||||||
from django_otp import devices_for_user
|
from django_otp import devices_for_user
|
||||||
from rest_framework.fields import CharField, IntegerField, JSONField, ListField, UUIDField
|
from rest_framework.fields import CharField, IntegerField, JSONField, ListField, UUIDField
|
||||||
|
@ -279,7 +280,7 @@ class AuthenticatorValidateStageView(ChallengeStageView):
|
||||||
def challenge_valid(self, response: AuthenticatorValidationChallengeResponse) -> HttpResponse:
|
def challenge_valid(self, response: AuthenticatorValidationChallengeResponse) -> HttpResponse:
|
||||||
# All validation is done by the serializer
|
# All validation is done by the serializer
|
||||||
user = self.executor.plan.context.get(PLAN_CONTEXT_PENDING_USER)
|
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)
|
webauthn_device: WebAuthnDevice = response.data.get("webauthn", None)
|
||||||
if not webauthn_device:
|
if not webauthn_device:
|
||||||
return self.executor.stage_ok()
|
return self.executor.stage_ok()
|
||||||
|
|
Reference in New Issue