diff --git a/identman/blueprints/__init__.py b/identman/blueprints/__init__.py index 0253288..2a79161 100644 --- a/identman/blueprints/__init__.py +++ b/identman/blueprints/__init__.py @@ -1,3 +1,4 @@ +import argon2.exceptions import binascii from json import JSONDecodeError import json @@ -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) diff --git a/identman/helper/settings.py b/identman/helper/settings.py index 6dedee5..6e38a8f 100644 --- a/identman/helper/settings.py +++ b/identman/helper/settings.py @@ -4,7 +4,6 @@ import yaml from pydantic_settings import BaseSettings, SettingsConfigDict -from pydantic import Field class CsrfSettings(BaseSettings): @@ -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()