-
Notifications
You must be signed in to change notification settings - Fork 228
Closed
Labels
bugThis points to a verified bug in the codeThis points to a verified bug in the code
Description
Checklist
- The issue can be reproduced in the react-native-auth0 sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
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
Labels
bugThis points to a verified bug in the codeThis points to a verified bug in the code