Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTokens() - Add check to see if tokens are expired (or will in 30s) and try to refresh if so #1506

Open
coleleep opened this issue Apr 8, 2024 · 0 comments

Comments

@coleleep
Copy link

coleleep commented Apr 8, 2024

Describe the feature request?

Add default behavior to perform a check to see if tokens are expired/expiring and perform a refresh if so. Currently getTokens() doesn't check for this.

We can write a method to do this but it would be idea if this was default behavior:

async function getAccessToken() {
  if (!(await oktaAuth.isAuthenticated()) {
    return null;
  }
  return oktaAuth.tokenManager.getTokens().accessToken;
}

New or Affected Resource(s)

getTokens();

Provide a documentation link

No response

Additional Information?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant