# React-native-aut0: authorize function from useAuth0 is giving null/undefined value. Unable to get accessToken token

**URL:** <https://community.auth0.com/t/react-native-aut0-authorize-function-from-useauth0-is-giving-null-undefined-value-unable-to-get-accesstoken-token/182370>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [February 18, 2025, 2:51pm UTC](https://community.auth0.com/t/react-native-aut0-authorize-function-from-useauth0-is-giving-null-undefined-value-unable-to-get-accesstoken-token/182370 "2025-02-18T14:51:13Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [February 24, 2025, 5:37pm UTC](https://community.auth0.com/t/react-native-aut0-authorize-function-from-useauth0-is-giving-null-undefined-value-unable-to-get-accesstoken-token/182370/7 "2025-02-24T17:37:39Z")

</div>

Hi @sunnydev

Sorry about the late reply.

Just to confirm, is the user logged in successfully whenever the accessToken is returned as undefined? If so, it might be a matter of the console log running prior to the accessToken being returned through the authorize call.

You could try to encapsulate the `authorize()` in a `try{}....catch{}` block in order to see if the call is executed successfully or what is the exact error returned.

Otherwise, the code you have presented should execute just fine. I would recommend to review our documentation regarding [React Native Quickstart](https://auth0.com/docs/quickstart/native/react-native/interactive).

Also, if you are using refresh tokens for your application, you might be missing the `offline_access` scope. I would recommend to review this [community post](https://community.auth0.com/t/get-tokens-for-native-app-and-its-backing-api-with-a-single-auth-flow-using-react-native-auth0/66172) regarding the matter and if you do not use refresh tokens, to read this [article](https://github.com/auth0/react-native-auth0/issues/245) on Github in order to see how to implement them.

Alternatively, you can also try using `getTokenSilently()` or `getAccessTokenSilently()`.

Hope this helps! Let me know if you have any other questions or updates on the matter!

Kind Regards,  
Nik

---

_[View the full topic](https://community.auth0.com/t/react-native-aut0-authorize-function-from-useauth0-is-giving-null-undefined-value-unable-to-get-accesstoken-token/182370)._
