Refactor password handling and model typing
Replaced custom password generation and verification logic with a new pkg/password.py module using Argon2 for secure hashing. Updated model field types to use PEP 604 union syntax (e.g., str | None) and improved type annotations. Refactored admin and session routes to use new password utilities and direct model methods for CRUD operations. Removed legacy tool-based password functions and cleaned up .idea project files.
This commit is contained in:
2
JWT.py
2
JWT.py
@@ -22,7 +22,7 @@ async def get_secret_key() -> str:
|
||||
global _SECRET_KEY_CACHE
|
||||
|
||||
if _SECRET_KEY_CACHE is None:
|
||||
async with Database.get_session() as session:
|
||||
async with Database.session_context() as session:
|
||||
setting = await Setting.get(
|
||||
session=session,
|
||||
condition=(Setting.name == 'SECRET_KEY')
|
||||
|
||||
Reference in New Issue
Block a user