исправление обработки 404

This commit is contained in:
2026-02-04 23:21:53 +03:00
parent a336d50ad0
commit 8ad70cdb7c
21 changed files with 173 additions and 201 deletions
+4 -2
View File
@@ -287,7 +287,8 @@ def enable_2fa(
if not current_user.totp_secret:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST, detail="Secret key not generated"
status_code=status.HTTP_400_BAD_REQUEST,
detail="Secret key not generated",
)
if not verify_totp_code(secret, data.code):
@@ -299,7 +300,8 @@ def enable_2fa(
decrypted = cipher.decrypt(base64.b64decode(current_user.totp_secret.encode()))
if secret != decrypted.decode():
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST, detail="Incorret secret"
status_code=status.HTTP_400_BAD_REQUEST,
detail="Incorret secret",
)
current_user.is_2fa_enabled = True