Skip to content

Commit

Permalink
🐛 Fix bug in verify_my_otp endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rapeeza1598 committed May 3, 2024
1 parent 8fdb51f commit ee90b1c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ async def send_otp(email_request: EmailRequest, background_tasks: BackgroundTask
@app.post("/verify-otp/")
async def verify_my_otp(otp_verification: OTPVerification,db: Session = Depends(get_db)):
if is_valid := verify_otp(db,otp_verification.email, otp_verification.otp):
verify_user_by_otp(db, otp_verification.email)
return {"detail": "OTP is valid"}
else:
raise HTTPException(status_code=400, detail="Invalid OTP")
Expand Down

0 comments on commit ee90b1c

Please sign in to comment.