Skip to content

Commit

Permalink
fix(users/me): correct OTP validation condition
Browse files Browse the repository at this point in the history
  • Loading branch information
zobweyt committed Oct 4, 2024
1 parent b97473f commit 63791f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/v1/users/me/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_current_user(current_user: CurrentUser) -> User:
def update_current_user_email(current_user: CurrentUser, args: CurrentUserEmailUpdateRequest, session: Session) -> User:
if is_email_registered(session, args.email):
raise HTTPException(status.HTTP_400_BAD_REQUEST, _("Email is already taken."))
if expire_otp_if_correct(args.email, args.otp):
if not expire_otp_if_correct(args.email, args.otp):
raise HTTPException(status.HTTP_406_NOT_ACCEPTABLE, _("The One-Time Password (OTP) is incorrect or expired."))

update_email(session, current_user, args.email)
Expand Down

0 comments on commit 63791f3

Please sign in to comment.