Skip to content

Commit

Permalink
fix: verify otp
Browse files Browse the repository at this point in the history
  • Loading branch information
flavien-hugs committed Jan 20, 2025
1 parent 8f036af commit 2e030cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/auth/phonenumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ async def reset_password_completed_with_phonenumber(payload: ChangePasswordWithO
status_code=status.HTTP_400_BAD_REQUEST,
)

otp_code_value = int(payload.code_otp)
if not otp_service.generate_otp_instance(user.attributes["otp_secret"]).verify(otp_code_value):
otp_code_value = str(payload.code_otp)
if not otp_service.generate_otp_instance(user.attributes["otp_secret"]).verify(otp=otp_code_value):
raise CustomHTTPException(
code_error=AuthErrorCode.AUTH_OTP_NOT_VALID,
message_error=f"Code OTP '{otp_code_value}' invalid",
Expand Down

0 comments on commit 2e030cc

Please sign in to comment.