Skip to content

v4: First class support to handle a Refresh Token rotation failure #2036

Open
@elijahkim

Description

@elijahkim

Checklist

  • I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

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

  1. Extend the existing Auth0Client and override the getAccessToken behavior

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions