# How can I update authState on redirect?

**URL:** <https://devforum.okta.com/t/how-can-i-update-authstate-on-redirect/21194>\
**Category:** Questions\
**Created:** [July 7, 2022, 4:01pm UTC](https://devforum.okta.com/t/how-can-i-update-authstate-on-redirect/21194 "2022-07-07T16:01:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![agusvdino](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@agusvdino](https://devforum.okta.com/u/agusvdino)\
**Post date:** [July 7, 2022, 4:01pm UTC](https://devforum.okta.com/t/how-can-i-update-authstate-on-redirect/21194/1 "2022-07-07T16:01:23Z")

</div>

Hey!  
I’m trying to develop a sign-in page with react that allows our users to log in once and then navigate to other apps without having to log in again. What this means is that a user would sign in on `auth.mydomain.com` and be able to acces `myapp1.mydomain.com`.  
During development I have the sign-in widget on port `8080` and my app on port `3000`. Right now I can log in on port `8080` and get redirected to port `3000`.  
After doing so, `authState.isAuthenticated` is false. I can go 2 separate ways from here. I can get the tokens using `oktaAuth.token.getWithoutPrompt()` but this does not update `authState`, neither does executing `oktaAuth.authStateManager.updateAuthState()` right after. The other way is to trigger a login with `oktaAuth.signInWithRedirect()` which updates `authState`, but this reloads the page and wrecks user experience.  
Here are the versions I’m using:

```auto
    "@okta/okta-auth-js": "^6.7.1",
    "@okta/okta-signin-widget": "^6.5.0",
    "@okta/okta-react": "^6.5.0"

```

`okta-signin-widget` is not present on the app in port `3000`.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 9:16pm UTC](https://devforum.okta.com/t/how-can-i-update-authstate-on-redirect/21194/2 "2024-02-12T21:16:18Z")

</div>


