-
Notifications
You must be signed in to change notification settings - Fork 229
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
The react-native-auth0 Expo config plugin is intended to be able to set up Android App Links, but following the instructions to configure it the App Link URL shows in the web browser instead of redirecting back to the app.
Reproduction
- Clone https://github.com/CodingItWrong/auth0-react-native-sample/tree/jjustice/android-app-links
- Configure an Auth0 tenant that is set up for Android App Links
- Run the app and sign in
- Expected: able to sign in
- Actual: redirect URL shows in the web browser instead
Additional context
I was able to get login working by using the following custom Expo config plugin instead of the official react-native-auth0
Expo config plugin. My custom plugin configures manifest placeholders. As I understand it, though, this shouldn't be necessary:
const { withAppBuildGradle } = require("expo/config-plugins")
const withAuth0 = (config, options) => {
config = withCustomAppBuildGradle(config, options)
return config
}
const withCustomAppBuildGradle = (config, options) => {
return withAppBuildGradle(config, (config) => {
// Add the manifestPlaceholders to support our app link
// https://github.com/auth0/react-native-auth0?tab=readme-ov-file#android-1
config.modResults.contents = config.modResults.contents.replace(
`minSdkVersion rootProject.ext.minSdkVersion`,
`manifestPlaceholders = [auth0Domain: "${options.domain}", auth0Scheme: "https"]
minSdkVersion rootProject.ext.minSdkVersion`,
)
return config
})
}
module.exports = withAuth0
You can try this and see it work in the repro by replacing the "react-native-auth0"
plugin with "./withAuth0.js"
. Video:
react-native-auth0 version
5.0.0-beta.3
React Native version
0.79.2
Expo version
53.0.9
Platform
Android
Platform version(s)
16
Videos
react-native-auth0 plugin, not working | custom plugin, working |
---|---|
auth0-plugin.webm |
custom-plugin.webm |
Metadata
Metadata
Assignees
Labels
bugThis points to a verified bug in the codeThis points to a verified bug in the code