# isAuthenticated always returns false (React)

**URL:** <https://community.auth0.com/t/isauthenticated-always-returns-false-react/60039>\
**Category:** Get Help\
**Tags:** login, auth0\
**Created:** [March 25, 2021, 6:06am UTC](https://community.auth0.com/t/isauthenticated-always-returns-false-react/60039 "2021-03-25T06:06:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tingwei758](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tingwei758/32/28364_2.png) [@tingwei758](https://community.auth0.com/u/tingwei758)\
**Post date:** [March 25, 2021, 6:06am UTC](https://community.auth0.com/t/isauthenticated-always-returns-false-react/60039/1 "2021-03-25T06:06:37Z")

</div>

When I tried to integrate auth0 with my react app, it seems that isAuthenticated is always false, even when login is successful. Has anyone encountered the same issue?

I am using auth0-react version 1.3.0. Tested with Safari and Chrome.

I have tested:

- calling _loginWithRedirect()_ a second time will not yield the login/signup page again, also the number of Logins is updated from the User Management console (so I am assuming login is successful)
- the sample app is working correctly
- refresh page does not solve the problem
- isLoading is not the problem (both _isLoading_ and _isAuthenticated_ are _false_ after login
- the Application Type is SPA

---

<div class="post-metadata">

**Author:** ![Ale](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ale/32/50860_2.png) [@Ale](https://community.auth0.com/u/Ale)\
**Post date:** [March 25, 2021, 12:57pm UTC](https://community.auth0.com/t/isauthenticated-always-returns-false-react/60039/2 "2021-03-25T12:57:33Z")

</div>

Welcome to the Auth0 Community, @tingwei758!

Could you check that the authentication API is returning to the correct callback URL without any issue, please?

In order for isAuthenticated to get set to true, the function in onRedirectCallback has to get called. If the redirectUri doesn’t load completely, the onRedirectCallback fn will not get called.

If the above is not the issue, my suggestion would be to try our React quickstart: when you create a new application within the Auth0 dashboard, you can try to download and run the Quickstart application example for React that is also available from the “Quickstart” tab on this page. If this works, then the issue would probably be on your code, so you could compare the code snippet of the callback handling code within the custom code written with the code that is in the quickstart sample, we may be able to identify what is different to cause the unexpected behavior.

---

<div class="post-metadata">

**Author:** ![tingwei758](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tingwei758/32/28364_2.png) [@tingwei758](https://community.auth0.com/u/tingwei758)\
**Post date:** [March 25, 2021, 7:04pm UTC](https://community.auth0.com/t/isauthenticated-always-returns-false-react/60039/3 "2021-03-25T19:04:47Z")

</div>

Thank you so much, Ale! You are right. The problem is that my redirectURI is incorrect.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 26, 2021, 8:00am UTC](https://community.auth0.com/t/isauthenticated-always-returns-false-react/60039/4 "2021-03-26T08:00:13Z")

</div>

Thanks for helping on this one @Ale !

---

<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:** [April 10, 2021, 8:00am UTC](https://community.auth0.com/t/isauthenticated-always-returns-false-react/60039/5 "2021-04-10T08:00:49Z")

</div>

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