Skip to content

fix(auth): fix verifyOTP parameter validation for OtpType.recovery with tokenHash#1295

Merged
grdsdev merged 1 commit into
mainfrom
guilherme/sdk-614-fix-verifyotp-parameter-validation-for-otptyperecovery
Jan 5, 2026
Merged

fix(auth): fix verifyOTP parameter validation for OtpType.recovery with tokenHash#1295
grdsdev merged 1 commit into
mainfrom
guilherme/sdk-614-fix-verifyotp-parameter-validation-for-otptyperecovery

Conversation

@grdsdev
Copy link
Copy Markdown
Contributor

@grdsdev grdsdev commented Jan 5, 2026

Description

Fixes #1159

The verifyOTP method was incorrectly requiring email or phone parameters when using OtpType.recovery with tokenHash. According to the backend API, when using recovery type with tokenHash, only token_hash and type should be provided.

Changes

  • Updated verifyOTP method to handle OtpType.recovery with tokenHash correctly
  • Added validation to ensure email/phone are not provided when using recovery type with tokenHash
  • Updated request body construction to exclude email/phone for recovery type with tokenHash
  • Added test cases to verify the fix works correctly

Testing

  • Added test case for recovery type with tokenHash (no email/phone)
  • Added test case to ensure recovery type with tokenHash rejects email/phone parameters

Related Issue

Closes #1159

@grdsdev grdsdev changed the title fix(auth): Fix verifyOTP parameter validation for OtpType.recovery with tokenHash fix(auth): fix verifyOTP parameter validation for OtpType.recovery with tokenHash Jan 5, 2026
@grdsdev grdsdev requested review from a team and Vinzent03 January 5, 2026 12:51
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 20715880402

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 79.962%

Totals Coverage Status
Change from base Build 20572079940: 0.01%
Covered Lines: 3364
Relevant Lines: 4207

💛 - Coveralls

@grdsdev grdsdev merged commit 0719e55 into main Jan 5, 2026
15 of 16 checks passed
@grdsdev grdsdev deleted the guilherme/sdk-614-fix-verifyotp-parameter-validation-for-otptyperecovery branch January 5, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong parameter assertions in verifyOTP

3 participants