Gregniuki commited on
Commit
0bcfe06
·
1 Parent(s): b81db0f

Update auth.py

Browse files
Files changed (1) hide show
  1. auth.py +3 -3
auth.py CHANGED
@@ -55,12 +55,12 @@ from emailx import send_verification_email, generate_verification_token
55
 
56
  def verify_email(self, verification_token: str, db: Session = Depends(get_db)):
57
  # Verify the email using the token (implement email.verify_token)
58
- email = email.verify_token(verification_token)
59
- if not email:
60
  raise HTTPException(status_code=400, detail="Invalid verification token")
61
 
62
  # Get the user by email
63
- user = database.get_user_by_email(db, email)
64
  if not user:
65
  raise HTTPException(status_code=400, detail="User not found")
66
 
 
55
 
56
  def verify_email(self, verification_token: str, db: Session = Depends(get_db)):
57
  # Verify the email using the token (implement email.verify_token)
58
+ emaila = email.verify_token(verification_token)
59
+ if not emaila:
60
  raise HTTPException(status_code=400, detail="Invalid verification token")
61
 
62
  # Get the user by email
63
+ user = database.get_user_by_email(db, emaila)
64
  if not user:
65
  raise HTTPException(status_code=400, detail="User not found")
66