Open robcaldecott opened 3 days ago
Hi @robcaldecott 👋 Thanks for the feedback! In the next release (linked above), the AccessTokenError
will be thrown when a new token could not be obtained. The error and codes will also be exported under @auth0/nextjs-auth0/errors
.
Checklist
Description
In our custom middleware we are checking for an auth0 session token like this:
However, I think
getAccessToken
can also throw errors, and if so we want to redirect to login. In this case we would need to handleAccessTokenError
so we can do something like this:However, I cannot find
AccessTokenError
in the auth0 package.For now I can instead do this:
But I think access to
AccessTokenError
would be preferred.Thanks in advance.
Reproduction
See above
Additional context
No response
nextjs-auth0 version
4.0.0-beta.6
Next.js version
15.0.3
Node.js version
20