Refactored DB handlers

This commit is contained in:
Logan Cusano
2025-05-26 02:36:21 -04:00
parent a9c1e24ef9
commit af10851002
5 changed files with 175 additions and 382 deletions

View File

@@ -24,6 +24,8 @@ def role_required(required_role: UserRoles):
# Make a DB call to get the user and their role
user = await current_app.user_db_h.find_user({"_id": user_id})
print("YERERERE", user)
if not user:
abort(401, "User not found or invalid token.") # User corresponding to token not found