Issue: Getting an “Invalid redirect URI” error after building the APK in Expo, even though development URLs work fine.
Project Context:
- I’m using a Wix headless React Native template with Expo for development.
- During development (using Expo), my OAuth URLs are configured and work like this:
** Allowed Redirect Domains: exp://172.16.0.181:8081
** Allowed Authorization Redirect URIs: exp://172.16.0.181:8081/–/oauth/wix/callback
Problem:
After building the APK in Expo for production testing, I updated the URLs to a production format that matches the app’s configuration, but they don’t work as expected.
Production URL Setup:
• Allowed Redirect Domains: myApp://oauth/wix/callback
(where “myApp” is the app-specific URI scheme defined in my app.json file)
• Allowed Authorization Redirect URIs: myApp://oauth/wix/callback
What I Tried:
Setting only “Allowed Authorization Redirect URIs” without “Allowed Redirect Domains” didn’t resolve the issue either.
Observed Behavior:
When I enter incorrect login credentials, the app correctly displays an “Email or Password is invalid” message.
However, with valid credentials, I receive an “Invalid redirect URI” error in response to the code below:
let response = await myWixClient.auth.login({
email: MEMBER_EMAIL,
password: MEMBER_PASSWORD,
});