Update auth.py
Browse files
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 |
-
|
59 |
-
if not
|
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,
|
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 |
|