Update appp.py
Browse files
appp.py
CHANGED
@@ -147,10 +147,10 @@ async def verify_recaptcha(recaptcha_token: str) -> bool:
|
|
147 |
async def verify_email(request: Request, token: str, db: Session = Depends(get_db)):
|
148 |
user = get_user_by_verification_token(db, token)
|
149 |
if not user:
|
150 |
-
return templates.TemplateResponse("verification_failed.html", {"request": request, "error_message": "Invalid verification token"})
|
151 |
|
152 |
if user.is_verified:
|
153 |
-
return templates.TemplateResponse("verification_failed.html", {"request": request, "error_message": "Email already verified"})
|
154 |
|
155 |
user.is_verified = True
|
156 |
user.email_verification_token = None
|
|
|
147 |
async def verify_email(request: Request, token: str, db: Session = Depends(get_db)):
|
148 |
user = get_user_by_verification_token(db, token)
|
149 |
if not user:
|
150 |
+
return templates.TemplateResponse("verification_failed.html", {"request": request, "error_message": "Invalid verification token"}, status_code=400)
|
151 |
|
152 |
if user.is_verified:
|
153 |
+
return templates.TemplateResponse("verification_failed.html", {"request": request, "error_message": "Email already verified"}, status_code=400)
|
154 |
|
155 |
user.is_verified = True
|
156 |
user.email_verification_token = None
|