forked from cardosofelipe/fast-next-template
Improve error handling, logging, and security in authentication services and utilities
- Refactored `create_user` and `change_password` methods to add transaction rollback on failures and enhanced logging for error contexts. - Updated security utilities to use constant-time comparison (`hmac.compare_digest`) to mitigate timing attacks. - Adjusted API responses in registration and password reset flows for better security and user experience. - Added session invalidation after password resets to enhance account security.
This commit is contained in:
@@ -62,7 +62,7 @@ async def get_my_organizations(
|
||||
# Add member count and role to each organization
|
||||
orgs_with_data = []
|
||||
for org in orgs:
|
||||
role = organization_crud.get_user_role_in_org(
|
||||
role = await organization_crud.get_user_role_in_org(
|
||||
db,
|
||||
user_id=current_user.id,
|
||||
organization_id=org.id
|
||||
|
||||
Reference in New Issue
Block a user