# oktaAuth.isLoginRedirect() returns False After Redirect Back

**URL:** <https://devforum.okta.com/t/oktaauth-isloginredirect-returns-false-after-redirect-back/26533>\
**Category:** OAuth/OIDC\
**Tags:** authjs\
**Created:** [January 27, 2024, 11:04pm UTC](https://devforum.okta.com/t/oktaauth-isloginredirect-returns-false-after-redirect-back/26533 "2024-01-27T23:04:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HappyEngineer](https://avatars.discourse-cdn.com/v4/letter/h/5f9b8f/32.png) [@HappyEngineer](https://devforum.okta.com/u/HappyEngineer)\
**Post date:** [January 27, 2024, 11:04pm UTC](https://devforum.okta.com/t/oktaauth-isloginredirect-returns-false-after-redirect-back/26533/1 "2024-01-27T23:04:30Z")

</div>

To resolve the issue detailed in [Redirect Issue: Successfully Logging in with Okta but Redirected to Okta Dev Dashboard Instead of redirectUri](https://devforum.okta.com/t/redirect-issue-successfully-logging-in-with-okta-but-redirected-to-okta-dev-dashboard-instead-of-redirecturi/26502), I made changes to the link of the ‘Sign with Google’ button in the Customized Help Links section, to be `https://{oktaDomain}/sso/idps/{googleIdpId}?fromURI="+encodeURI(redirectUrl);`. This allowed me to successfully redirect back to my specified redirectUri after logging in with a Google account.

However, I observed that `oktaAuth.isLoginRedirect()` returns `false` after the redirect back, and it becomes `true` only when I call `oktaAuth.signInWithRedirect()` again.  
How can I address this? Is there a way to set `oktaAuth.isLoginRedirect()` to `true` immediately upon redirecting back to the redirectUri?

 ![截屏2024-01-27 下午5.52.09](https://global.discourse-cdn.com/oktadev/original/2X/b/b68ba2af8a8c73c4c9b757a01ee98ace9c4ad936.png)

---

<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 2, 2024, 10:46pm UTC](https://devforum.okta.com/t/oktaauth-isloginredirect-returns-false-after-redirect-back/26533/2 "2024-02-02T22:46:52Z")

</div>

You need to kick off the /authorize request once Okta redirects back to your application. When logging in through an external Idp in Okta Classic, the flow will only get you into the Okta dashboard. Passing a fromURI to the /sso/idps endpoint will only ensure that users are sent back to your application, not that the /authorize request would be made.

So yes, you will need to call signInWithRedirect to complete the login flow for these federated users so that your application can receive tokens.

---

<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:** [March 3, 2024, 10:47pm UTC](https://devforum.okta.com/t/oktaauth-isloginredirect-returns-false-after-redirect-back/26533/3 "2024-03-03T22:47:37Z")

</div>

Closed on March 3, 2024, 10:47pm UTC

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