stages/authenticator_validate: handle non-existent device_challenges
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
c87f6cd9d9
commit
15e2032493
|
@ -196,7 +196,10 @@ class AuthenticatorValidateStageView(ChallengeStageView):
|
||||||
return super().get(request, *args, **kwargs)
|
return super().get(request, *args, **kwargs)
|
||||||
|
|
||||||
def get_challenge(self) -> AuthenticatorValidationChallenge:
|
def get_challenge(self) -> AuthenticatorValidationChallenge:
|
||||||
challenges = self.request.session["device_challenges"]
|
challenges = self.request.session.get("device_challenges")
|
||||||
|
if not challenges:
|
||||||
|
LOGGER.debug("Authenticator Validation stage ran without challenges")
|
||||||
|
return self.executor.stage_invalid()
|
||||||
return AuthenticatorValidationChallenge(
|
return AuthenticatorValidationChallenge(
|
||||||
data={
|
data={
|
||||||
"type": ChallengeTypes.NATIVE.value,
|
"type": ChallengeTypes.NATIVE.value,
|
||||||
|
|
Reference in New Issue