Gregniuki commited on
Commit
468038a
1 Parent(s): 5c35a7b

Update appp.py

Browse files
Files changed (1) hide show
  1. appp.py +2 -2
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