Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion identman/blueprints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argon2.exceptions
import binascii
from json import JSONDecodeError
import json
Expand Down Expand Up @@ -56,7 +57,7 @@ async def challenge(request: Request, csrf_protect: CsrfProtect = Depends()):
logger.debug(f"decrypted String: {plain}")
message = Message.validate(json.loads(plain))
data = message.model_dump(exclude_none=True)
except (JSONDecodeError, InvalidTag, ValueError, binascii.Error) as e:
except (JSONDecodeError, InvalidTag, ValueError, binascii.Error, argon2.exceptions.HashingError) as e:
logger.warning(f"Dexryption/Parsing Error: {e}")
response = JSONResponse(status_code=400, content={"error": "Invalider QR Code"})
csrf_protect.unset_csrf_cookie(response)
Expand Down
3 changes: 1 addition & 2 deletions identman/helper/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import yaml

from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic import Field


class CsrfSettings(BaseSettings):
Expand Down Expand Up @@ -32,7 +31,7 @@ class DummyAPISettings(BaseSettings):
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")

cors_origins: List[str] = ["http://localhost", "http://127.0.0.1:3000", "http://127.0.0.1"]
cors_origins: List[str] = ["http://localhost", "http://127.0.0.1:3000", "http://127.0.0.1", "https://127.0.0.1"]
backend: str = "sample"
leading_zeros: int = 4
csrf_settings: CsrfSettings = CsrfSettings()
Expand Down