GitHub Actions commited on
Commit
937453e
·
1 Parent(s): b1fb33d

Deploy backend from GitHub Actions

Browse files

🚀 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. src/security/dependencies.py +9 -9
src/security/dependencies.py CHANGED
@@ -102,13 +102,13 @@ def get_current_user(
102
  detail="User not found"
103
  )
104
 
105
- # Check if user is verified (optional)
106
- import os
107
- if not user.email_verified and os.getenv("ENVIRONMENT") != "development":
108
- raise HTTPException(
109
- status_code=status.HTTP_403_FORBIDDEN,
110
- detail="Email not verified. Please verify your email first."
111
- )
112
 
113
  return user
114
 
@@ -150,7 +150,7 @@ def get_optional_current_user(
150
  return None
151
 
152
  user = db.query(User).filter(User.id == user_id).first()
153
- return user if user and user.email_verified else None
154
 
155
  except Exception:
156
  return None
@@ -268,7 +268,7 @@ def get_current_user_or_anonymous(
268
  user_id = payload.get("sub")
269
  if user_id:
270
  user = db.query(User).filter(User.id == user_id).first()
271
- if user and user.email_verified:
272
  user.is_authenticated = True
273
  return user
274
  except Exception:
 
102
  detail="User not found"
103
  )
104
 
105
+ # Check if user is verified (optional) - Disabled for now
106
+ # import os
107
+ # if not user.email_verified and os.getenv("ENVIRONMENT") != "development":
108
+ # raise HTTPException(
109
+ # status_code=status.HTTP_403_FORBIDDEN,
110
+ # detail="Email not verified. Please verify your email first."
111
+ # )
112
 
113
  return user
114
 
 
150
  return None
151
 
152
  user = db.query(User).filter(User.id == user_id).first()
153
+ return user if user else None # Return user regardless of email_verified status
154
 
155
  except Exception:
156
  return None
 
268
  user_id = payload.get("sub")
269
  if user_id:
270
  user = db.query(User).filter(User.id == user_id).first()
271
+ if user: # Removed email_verified check
272
  user.is_authenticated = True
273
  return user
274
  except Exception: