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 929d4f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class AuthBaseConfig(BaseSettings):
REGISTER_USER_ENDPOINT_SECURITY_ENABLED: Optional[bool] = Field(
..., alias="REGISTER_USER_ENDPOINT_SECURITY_ENABLED"
)
LIST_PARAMETERS_ENDPOINT_SECURITY_ENABLED: Optional[bool] = Field(
..., alias="LIST_PARAMETERS_ENDPOINT_SECURITY_ENABLED"
)
USE_TRACK_ACTIVITY_LOGS: Optional[bool] = Field(default=True, alias="USE_TRACK_ACTIVITY_LOGS")
LIST_PARAMETERS_ENDPOINT_SECURITY_ENABLED: Optional[bool] = Field(
default=False, alias="LIST_PARAMETERS_ENDPOINT_SECURITY_ENABLED"
Expand Down
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 929d4f4

Please sign in to comment.