Hi, I’m using the React @okta/okta-react library and need a way to refresh the ACCESS_TOKEN if the user has gone away for some time or switched their wifi network?
Is there are similar method like this.props.auth.getAccessToken() to refresh the token?
This happens automatically underneath the hood by the token manager if a refresh token (offline_access scope) is delivered to your react app. Let me know any questions!
That’s pretty strange behavior, as @tom is right, the tokenManager should keep the tokens fresh for you. You mention users switching wifi networks. Is that one way to consistently reproduce it, or do you just wait until the token expires?
Figured that out, I was firing checkAuthenticated on componentDidMount and not componentDidUpdate which would fire if the user returns to the browser tab with the page loaded.