# handleRedirectCallback fails on Safari browser

**URL:** <https://community.auth0.com/t/handleredirectcallback-fails-on-safari-browser/124937>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [January 16, 2024, 8:30pm UTC](https://community.auth0.com/t/handleredirectcallback-fails-on-safari-browser/124937 "2024-01-16T20:30:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmgayosso](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmgayosso/32/53976_2.png) [@jmgayosso](https://community.auth0.com/u/jmgayosso)\
**Post date:** [January 16, 2024, 8:30pm UTC](https://community.auth0.com/t/handleredirectcallback-fails-on-safari-browser/124937/1 "2024-01-16T20:30:18Z")

</div>

Hi community, we are using loginWithRedirection and handleRedirectCallback methods to login,

```auto
if (!isAuthenticated && !code) {
      if (returnUrl) localStorage.setItem('returnUrl', returnUrl)
      if (returnParams) localStorage.setItem('returnParams', JSON.stringify(returnParams))
      if (newQuery) localStorage.setItem('query', JSON.stringify(newQuery))

      await this.$auth0.loginWithRedirect({
        authorizationParams: {
          redirect_uri: window.location.origin
        }
      })
      return
    }

    if (!isAuthenticated && code) {
      const storedReturnUrl = localStorage.getItem('returnUrl')
      const storedReturnParams = localStorage.getItem('returnParams')
      const storedQuery = localStorage.getItem('query')

      if (storedReturnUrl) returnUrl = storedReturnUrl
      if (storedReturnParams) returnParams = JSON.parse(storedReturnParams)
      if (storedQuery) newQuery = JSON.parse(storedQuery)

      await this.$auth0.handleRedirectCallback()
    }

```

this works as expected on Chrome and Firefox but in Safari we get the following error when we call ‘handleRedirectCallback’:

> TypeError: undefined is not an object (evaluating ‘e.split’)

In our prod env we have a custom auth domain but the issue happen on dev and prod envs.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [January 17, 2024, 12:17am UTC](https://community.auth0.com/t/handleredirectcallback-fails-on-safari-browser/124937/2 "2024-01-17T00:17:04Z")

</div>

Hey there @jmgayosso welcome to the community!

> [@jmgayosso](#):
>
> this works as expected on Chrome and Firefox but in Safari we get the following error when we call ‘handleRedirectCallback’:

Interesting - Which SDK and version are you using? Are you able to share how you’ve configured `Auth0Client` or `Auth0Provider`? Do you have any rules/Actions in place in your tenant that could be interfering? Given that everything is functioning as expected in other browsers, there might be a setting in Safari causing issues.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 31, 2024, 12:47am UTC](https://community.auth0.com/t/handleredirectcallback-fails-on-safari-browser/124937/4 "2024-01-31T00:47:49Z")

</div>

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