forked from cardosofelipe/fast-next-template
Refactor authentication services to async password handling; optimize bulk operations and queries
- Updated `verify_password` and `get_password_hash` to their async counterparts to prevent event loop blocking. - Replaced N+1 query patterns in `admin.py` and `session_async.py` with optimized bulk operations for improved performance. - Enhanced `user_async.py` with bulk update and soft delete methods for efficient user management. - Added eager loading support in CRUD operations to prevent N+1 query issues. - Updated test cases with stronger password examples for better security representation.
This commit is contained in:
@@ -39,7 +39,7 @@ class TestCRUDErrorPaths:
|
||||
# Create first user
|
||||
user_data = UserCreate(
|
||||
email="unique@example.com",
|
||||
password="Password123",
|
||||
password="Password123!",
|
||||
first_name="First"
|
||||
)
|
||||
user_crud.create(db_session, obj_in=user_data)
|
||||
@@ -52,7 +52,7 @@ class TestCRUDErrorPaths:
|
||||
"""Test create handles other integrity errors."""
|
||||
user_data = UserCreate(
|
||||
email="integrityerror@example.com",
|
||||
password="Password123",
|
||||
password="Password123!",
|
||||
first_name="Integrity"
|
||||
)
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestCRUDErrorPaths:
|
||||
"""Test create handles unexpected errors."""
|
||||
user_data = UserCreate(
|
||||
email="unexpectederror@example.com",
|
||||
password="Password123",
|
||||
password="Password123!",
|
||||
first_name="Unexpected"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user