Occasionally (maybe once per week per user) when we call getCredentials to retrieve a stored credential for a logged in user, as recommended here the accessToken field is nil. What does that mean, and how can we recover without logging the user out?
Hi @johan.lindell, and welcome back to the Auth0 Community!
I’ve done a bit of research and there seems to be an open issue on Github, similar to what you are describing, although they are receiving undefined from the getCredentials method.
Generally, this method returns null when the accessToken has expired and there is an issue with the refreshToken that doesn’t permit the SDK to obtain a new accessToken.
Perhaps you could try to add a check for the null, which calls the getCredentials function again with the forceRefresh parameter set to true. This will make sure you get a new access token. If this call fails as well, then there is a good chance the problem is the refresh token.