Skip to content

v.5.0.0-beta2 and beta4 After login with authorize app deep links to the callback url which causes the app to land on the not found screen. #1260

@letidev

Description

@letidev

Checklist

Description

After upgrading to Expo SDK 53, I upgraded the auth0 package to v5.0.0-beta4 but after taking a look at issue #1259 I downgraded to beta2 as it mentions that it's more stable than beta4. The issue was present with both versions.

Here's the setup:

app
|--- (app) <-- protected routes
|    |--- (tabs)
|    |    |--- _layout.tsx
|    |    |--- index.tsx
|    |--- _layout.tsx
|
|--- _layout.tsx
|--- login.tsx

In the RootLayout which is in app/_layout.tsx we have:

export default RootLayout = () => {
  const { isLoggedIn } = useAuthContext()

  console.log("Pathname: ", usePathname())

  return (
   <Stack>
      <Stack.Protected guard={isLoggedIn}>
        <Stack.Screen name="(app)" />
      </Stack.Protected>

      <Stack.Screen name="login" />
    </Stack>
  )
}

On the login screen, after authorize from useAuth0 resolves successfully I do router.replace("/")

If we monitor the pathname that is console logged in the root layout we observe the following:

Pathname: /login
Pathname: /the-auth0-callback-url (which has this layout - <BUNDLE_IDENTIFIER.auth0://DOMAIN/ios/BUNDLE_IDENTIFIER/callback>
Pathname: /

It seems like the app tries to deeplink to a screen with the callback url route (which obviously doesn't exist) so we end up at the not found screen and then the redirect from the login screen takes place.

Reproduction

see above

Additional context

No response

react-native-auth0 version

5.0.0-beta2

React Native version

0.79.5

Expo version

53.0.0

Platform

iOS

Platform version(s)

IOS 18.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions