# AuthState is null, after /callback

**URL:** <https://devforum.okta.com/t/authstate-is-null-after-callback/21032>\
**Category:** Questions\
**Tags:** reactjs\
**Created:** [June 21, 2022, 6:58am UTC](https://devforum.okta.com/t/authstate-is-null-after-callback/21032 "2022-06-21T06:58:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay303](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@Akshay303](https://devforum.okta.com/u/Akshay303)\
**Post date:** [June 21, 2022, 6:58am UTC](https://devforum.okta.com/t/authstate-is-null-after-callback/21032/1 "2022-06-21T06:58:57Z")

</div>

Hi,

I have created a developer okta account and created a sample application in ReactJS.

I have written logic to implement the same, referring to the official docs of okta-react lib. When the correct credentials are entered and Login button is hit, the form is submitted and application hits the Okta endpoint and then gets stuck at the “/callback” URL.

After “/callback” it is supposed to come back to the Homepage of the application, in this case the home page has path “/parts/single”.

There are no errors in console window, also my localhost path “[http://localhost:3000](http://localhost:3000)” is added in the trusted origins and redirect in Okta Security dashboard.

Please suggest some solution at earliest.

regards,  
Akshay

---

<div class="post-metadata">

**Author:** ![Akshay303](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@Akshay303](https://devforum.okta.com/u/Akshay303)\
**Post date:** [June 30, 2022, 4:50am UTC](https://devforum.okta.com/t/authstate-is-null-after-callback/21032/2 "2022-06-30T04:50:39Z")

</div>

Was able to fix the problem, Issue was with the router.

I was using the HashRouter which was tampering the callback URL, changed router to BrowserRouter and its working correct, as expected now.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [July 1, 2022, 4:51am UTC](https://devforum.okta.com/t/authstate-is-null-after-callback/21032/3 "2022-07-01T04:51:10Z")

</div>

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