Skip to content

Preemptive Refresh Feature Request #2191

Open
@thomashzhang

Description

@thomashzhang

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

I've been tasked with preemptively refreshing the user access token at half of the token lifetime. Regardless of opinions on architecture, there's doesn't appear to be a way to achieve this given getAccessToken (

(session.refreshToken && session.accessTokenExpiresAt * 1000 - 60000 < Date.now()) ||
) automatically refreshes at the 1 minute mark instead allowing a half time refresh.

Describe the ideal solution

This ideal solution is adding a parameter to getAccessToken getAccessToken({refreshThresholdPercent: 50})

Alternatives and current workarounds

Alternative is not having preemptive refresh.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions