[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2024-07-07 12:19:27 +00:00
committed by Mawoka
parent 800711b8b6
commit 518a9d72f9
7 changed files with 5808 additions and 4189 deletions
+7 -7
View File
@@ -102,19 +102,19 @@ def verify_webauthn(data, fidocredentialss: list[FidoCredentials], login_session
@router.post("/start")
async def start_login(data: StartLoginInput):
user = (
#TODO Find out why the fidocredentialls call fails
# TODO Find out why the fidocredentialls call fails
await User.objects.select_related("fidocredentialss")
.filter((User.email == data.email) | (User.username == data.email))
.get_or_none()
# await User.objects.filter((User.email == data.email) | (User.username == data.email))
# .get_or_none()
# await User.objects.filter((User.email == data.email) | (User.username == data.email))
# .get_or_none()
)
print("User.objects.filter call completed...")
step_1: set[StartLoginResponseTypes] = set()
step_2: set[StartLoginResponseTypes] = set()
webauthn_data = None
webauthn_challenge = None
print("\"webauthn_challenge = None\" call completed...")
print('"webauthn_challenge = None" call completed...')
print("user.verified: " + str(user.verified))
if user is None or not user.verified:
step_1.add(StartLoginResponseTypes.PASSWORD)
@@ -122,7 +122,7 @@ async def start_login(data: StartLoginInput):
print("Okay. User is not None or unverified...")
if user.password is not None:
step_1.add(StartLoginResponseTypes.PASSWORD)
''' TODO Find out why fidocredentialss is causing problems
""" TODO Find out why fidocredentialss is causing problems
if len(user.fidocredentialss) > 0:
if user.require_password is True:
step_2.add(StartLoginResponseTypes.PASSKEY)
@@ -137,7 +137,7 @@ async def start_login(data: StartLoginInput):
)
webauthn_challenge = base64.b64encode(webauthn_data.challenge).decode("utf-8")
webauthn_data = options_to_json(webauthn_data)
'''
"""
print("Moving past commented code, the long string one...")
if user.totp_secret is not None:
if user.require_password:
@@ -180,7 +180,7 @@ async def step_1_endpoint(session_id: str, data: StepInput, request: Request, re
else:
print("unknown step")
raise HTTPException(401)
#TODO fidocredentials bug fix user = await User.objects.select_related("fidocredentialss").get_or_none(id=uuid.UUID(login_session.user_id))
# TODO fidocredentials bug fix user = await User.objects.select_related("fidocredentialss").get_or_none(id=uuid.UUID(login_session.user_id))
user = await User.objects.get_or_none(id=uuid.UUID(login_session.user_id))
if data.auth_type == StartLoginResponseTypes.PASSWORD:
if verify_password(data.data, user.password):