# Okta-auth-js handleRedirect with okta sign in widget

**URL:** <https://devforum.okta.com/t/okta-auth-js-handleredirect-with-okta-sign-in-widget/25068>\
**Category:** OAuth/OIDC\
**Created:** [August 17, 2023, 6:00pm UTC](https://devforum.okta.com/t/okta-auth-js-handleredirect-with-okta-sign-in-widget/25068 "2023-08-17T18:00:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanmr](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/ryanmr/32/4897_2.png) [@ryanmr](https://devforum.okta.com/u/ryanmr)\
**Post date:** [August 17, 2023, 6:00pm UTC](https://devforum.okta.com/t/okta-auth-js-handleredirect-with-okta-sign-in-widget/25068/1 "2023-08-17T18:00:56Z")

</div>

The [documentation in okta-auth-js mentions that handleLoginRedirect may be deprecated](https://github.com/okta/okta-auth-js#handleloginredirecttokens-originaluri) in a future version.

> ⚠ Deprecated, this method could be removed in next major release, use [sdk.handleRedirect](https://github.com/okta/okta-auth-js#handleredirectoriginaluri) instead.

The okta sign in widget documentation has an recommendation for SPAs to use `showSignIn` with the example that uses `handleLoginRedirect` in the promise-then, but not `handleRedirect`.

```auto
oktaSignIn.showSignIn({
  // Assumes there is an empty element on the page with an id of ‘osw-container’
  el: ‘#osw-container’,
}).then(response => {
  oktaSignIn.authClient.handleLoginRedirect(res.tokens);
}).catch(function(error) {
  // This function is invoked with errors the widget cannot recover from:
  // Known errors: CONFIG_ERROR, UNSUPPORTED_BROWSER_ERROR
  console.log('login error', error);
});

```

I’d like to know what the alternative function, method call or approach if handleLoginRedirect is deprecated. `handleLogin` does not accept token parameters so using it in the same way may not be possible.

---

<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 15, 2024, 11:51pm UTC](https://devforum.okta.com/t/okta-auth-js-handleredirect-with-okta-sign-in-widget/25068/2 "2024-02-15T23:51:36Z")

</div>

Closed on February 15, 2024, 11:51pm UTC


