Skip to content

feat: Allow verifyToken to throw errors#63

Merged
quuu merged 1 commit intovercel:mainfrom
max-stytch:main
Jul 8, 2025
Merged

feat: Allow verifyToken to throw errors#63
quuu merged 1 commit intovercel:mainfrom
max-stytch:main

Conversation

@max-stytch
Copy link
Contributor

It would be great if verifyToken could throw an error directly to trigger re-authentication. I imagine people will be doing things like validating JWT signatures there (at least - that’s what I’m doing!).

If my validation method throws an error, it triggers the Unexpected error authenticating bearer token block here which means application code needs to catch its own errors and then either return undefined or re-throw as the proper underlying mcp auth error class, both of which are rather annoying.

@quuu
Copy link
Collaborator

quuu commented Jun 19, 2025

@dvoytenko

@dvoytenko
Copy link
Member

@quuu this looks good

@quuu quuu merged commit 4605b9a into vercel:main Jul 8, 2025
1 check passed
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.

3 participants