Checklist
Describe the problem you'd like to have solved
The SDK doesn't expose a way to handle a Refresh Token rotation failure. The hack I came up with was to wrap a call to getAccessToken with a try/catch which is less than ideal.
Describe the ideal solution
It would be great if the SDK exposed a way to handle these failure cases. Currently the middleware hijacks the accessToken route here and throws an error upon failure. This forces the client to handle these errors in a try/catch block.
If the client init took some sort of callback that was called on failure, we would be able to define the behavior we wanted in a single place instead of wrapping every call to fetch an access token with a try/catch.
Alternatives and current workarounds
- Extend the existing Auth0Client and override the
getAccessToken behavior
Additional context
No response
Checklist
Describe the problem you'd like to have solved
The SDK doesn't expose a way to handle a Refresh Token rotation failure. The hack I came up with was to wrap a call to
getAccessTokenwith atry/catchwhich is less than ideal.Describe the ideal solution
It would be great if the SDK exposed a way to handle these failure cases. Currently the middleware hijacks the
accessTokenroute here and throws an error upon failure. This forces the client to handle these errors in atry/catchblock.If the client init took some sort of callback that was called on failure, we would be able to define the behavior we wanted in a single place instead of wrapping every call to fetch an access token with a
try/catch.Alternatives and current workarounds
getAccessTokenbehaviorAdditional context
No response