Skip to content

fix: keep original error as inner on secret callback failure - #1057

Open
webdevelopersrinu wants to merge 1 commit into
auth0:masterfrom
webdevelopersrinu:fix-secret-callback-error
Open

webdevelopersrinu wants to merge 1 commit into
auth0:masterfrom
webdevelopersrinu:fix-secret-callback-error

Conversation

@webdevelopersrinu

Copy link
Copy Markdown

Fixes #746

When the secretOrPublicKey callback fails, the original error was only
kept as text inside the message. So the only way to know what failed was
parsing the message string. I changed verify to also set the original
error as err.inner, same as other errors in this library already do.

Updated the two existing tests to check err.inner. All tests pass.

Fixes auth0#746. The error from the secretOrPublicKey callback was only kept
as text in the message, so callers could not check what actually failed.
Now it is also set as err.inner.
@webdevelopersrinu
webdevelopersrinu requested a review from a team as a code owner November 20, 2026 05:28
@webdevelopersrinu webdevelopersrinu changed the title keep original error as inner on secret callback failure fix: keep original error as inner on secret callback failure Nov 20, 2026
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.

Distinguish errors from secret or public key callback

1 participant