# Carry login information between route navigations ReactJS

**URL:** <https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836>\
**Category:** OAuth/OIDC\
**Tags:** reactjs, react\
**Created:** [December 2, 2017, 11:37am UTC](https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836 "2017-12-02T11:37:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogeralsing](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rogeralsing](https://devforum.okta.com/u/rogeralsing)\
**Post date:** [December 2, 2017, 11:37am UTC](https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836/1 "2017-12-02T11:37:07Z")

</div>

Edit, my issue seems to be that `isAuthenticated` returns null, is there any documentation on how this should work?

---

<div class="post-metadata">

**Author:** ![rogeralsing](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rogeralsing](https://devforum.okta.com/u/rogeralsing)\
**Post date:** [December 2, 2017, 12:43pm UTC](https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836/2 "2017-12-02T12:43:02Z")

</div>

I’ve modified the code in my Home.js to have this code:

```auto
  async checkAuthentication() {
    const authenticated = await this.props.auth.isAuthenticated();
    console.log("Authenticated as " + authenticated); //<-- added logging
    if (authenticated !== this.state.authenticated) {
      this.setState({ authenticated });
    }
  }

```

When I press Logon, the output I’m seeing that the result of the isAuthenticated() call is “null”

Why and how can I find out why I am not getting any result back?

---

<div class="post-metadata">

**Author:** ![rogeralsing](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rogeralsing](https://devforum.okta.com/u/rogeralsing)\
**Post date:** [December 2, 2017, 1:58pm UTC](https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836/3 "2017-12-02T13:58:30Z")

</div>

I’ve partially figured out what is going on.

if I’m at `localhost:3000/` then press login, Okta is redirecting me back to this URI after logging in.  
The `/implicit/callback` is never triggered as that is not the URI that I’m redirected back to.

So I think I am confused on what should go where,  
Should the implicit callback be at /implicit/callback, and is that the redirect uri that should be available in the Admin dashboard?

This is how I read the example. but doing so will result in the user not being logged into the APP.  
If I instad change the route path of the implicit callback to be just `/` then it gets triggered after the login, and I get the correct information.

I’m not sure if I’m holding it wrong, or if the tutorial is wrong or if there is a bug in the SDK.  
Following the React SDK point by point, will result in an error saying that the URI (/ which is Home) is not whitelisted.

I could use some helping hand here

---

<div class="post-metadata">

**Author:** ![rogeralsing](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rogeralsing](https://devforum.okta.com/u/rogeralsing)\
**Post date:** [December 2, 2017, 7:41pm UTC](https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836/4 "2017-12-02T19:41:48Z")

</div>

I found the issue

In one if the examples, there is this code

```auto
    redirectUri: window.location.origin + '/implicit/callback', //<-- redirectUri
    clientId: clientId
}

```

and in another snippet there is this:

```auto
redirect_uri={config.redirectUri} > //<-- redirect_uri

```

using the same in both places solved the issue.

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [December 2, 2017, 9:13pm UTC](https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836/5 "2017-12-02T21:13:34Z")

</div>

We’re glad to see you figured it out!

---

<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:** [January 12, 2024, 9:25pm UTC](https://devforum.okta.com/t/carry-login-information-between-route-navigations-reactjs/836/6 "2024-01-12T21:25:40Z")

</div>

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