# React Native access token is randomly null

**URL:** <https://community.auth0.com/t/react-native-access-token-is-randomly-null/187948>\
**Category:** Get Help\
**Tags:** react-native-auth0, sdks-quickstarts\
**Created:** [June 14, 2025, 5:23am UTC](https://community.auth0.com/t/react-native-access-token-is-randomly-null/187948 "2025-06-14T05:23:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johan.lindell](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/johan.lindell/32/71466_2.png) [@johan.lindell](https://community.auth0.com/u/johan.lindell)\
**Post date:** [June 14, 2025, 5:23am UTC](https://community.auth0.com/t/react-native-access-token-is-randomly-null/187948/1 "2025-06-14T05:23:35Z")

</div>

We are using

```auto
"react-native-auth0": "4.6.0",

```

Occasionally (maybe once per week per user) when we call `getCredentials` to retrieve a stored credential for a logged in user, as recommended [here](https://github.com/auth0/react-native-auth0?tab=readme-ov-file#retrieve-stored-credentials) the accessToken field is nil. What does that mean, and how can we recover without logging the user out?

---

<div class="post-metadata">

**Author:** ![teodor.andrei](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/teodor.andrei/32/75320_2.png) [@teodor.andrei](https://community.auth0.com/u/teodor.andrei)\
**Post date:** [June 20, 2025, 11:48am UTC](https://community.auth0.com/t/react-native-access-token-is-randomly-null/187948/3 "2025-06-20T11:48:31Z")

</div>

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](https://github.com/auth0/react-native-auth0/issues/1158) 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.

I hope this helps you!

Sincerely,  
Teodor.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 4, 2025, 11:49am UTC](https://community.auth0.com/t/react-native-access-token-is-randomly-null/187948/4 "2025-07-04T11:49:31Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
