Debian Codegraph @

allauth/mfa/webauthn/stages.py

raw
1 from __future__ import annotations
2
3 from django.http import HttpResponseBase
4
5 from allauth.account.stages import LoginStage
6 from allauth.core.internal.httpkit import headed_redirect_response
7 from allauth.mfa.internal.constants import LoginStageKey
8
9
10 class PasskeySignupStage(LoginStage):
11 key = LoginStageKey.MFA_SIGNUP_WEBAUTHN.value
12 urlname = "mfa_signup_webauthn"
13
14 def handle(self) -> tuple[HttpResponseBase | None, bool]:
15 response, cont = None, True
16 if self.login.state.get("passkey_signup"):
17 response = headed_redirect_response("mfa_signup_webauthn")
18 return response, cont