Skip to content

fix(otp): handle conflicting issuer in otpauth URI query param#38

Merged
rxtsel merged 2 commits into
mainfrom
fix/otp-issuer-mismatch
Jun 19, 2026
Merged

fix(otp): handle conflicting issuer in otpauth URI query param#38
rxtsel merged 2 commits into
mainfrom
fix/otp-issuer-mismatch

Conversation

@rxtsel

@rxtsel rxtsel commented Jun 19, 2026

Copy link
Copy Markdown
Owner

When the OTP URI has an issuer in the path label (e.g., 'issuer:account') and a different issuer in the query parameter, totp-rs rejects it with an issuer mismatch error. Drop the issuer query parameter when the path already contains an issuer, since the path issuer takes precedence per the otpauth spec.

Also improve error reporting by preserving the specific TotpUrlError cause instead of mapping to a generic message, and by showing the URL parse error when normalization fails.

rxtsel added 2 commits June 19, 2026 18:33
When the OTP URI has an issuer in the path label (e.g., 'issuer:account')
and a different issuer in the query parameter, totp-rs rejects it with
an issuer mismatch error. Drop the issuer query parameter when the path
already contains an issuer, since the path issuer takes precedence per
the otpauth spec.

Also improve error reporting by preserving the specific TotpUrlError
cause instead of mapping to a generic message, and by showing the URL
parse error when normalization fails.
@rxtsel rxtsel merged commit 00479d5 into main Jun 19, 2026
9 checks passed
@rxtsel rxtsel deleted the fix/otp-issuer-mismatch branch June 19, 2026 23:39
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.

1 participant