expo: ValidationError: "returnUrl" must be a valid uri
Summary
As mentioned in this comment a new issue should be opened for using the projectNameForProxy property.
I get "returnUrl" must be a valid uri regardless of useProxy being true or false
Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
45
Environment
expo-env-info 1.0.4 environment info:
System:
OS: macOS 12.4
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.1 - /opt/homebrew/opt/node@16/bin/node
npm: 8.11.0 - /opt/homebrew/opt/node@16/bin/npm
Watchman: 2022.06.13.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8193401
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
npmGlobalPackages:
eas-cli: 0.54.1
expo-cli: 5.4.12
Reproducible demo
Same as original issue thread:
import * as AuthSession from "expo-auth-session";
const redirectUri = AuthSession.makeRedirectUri({
native: "com.myapp://",
useProxy:false
});
const authUrl = `https://supabaseproject.supabase.co/auth/v1/authorize?provider="google"&redirect_to=${redirectUri}`;
const signIn = async () => {
const authRes = await AuthSession.startAsync({
authUrl,
returnUrl: redirectUri,
});
};
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 12
- Comments: 15 (5 by maintainers)
same here… don’t know how to solve it
we deprecated the auth proxy (
useProxy), which is whatAuthSession.startAsyncis meant for. I recommend usinguseAuthRequestif you’re interacting with an openid/oauth service, or otherwise, use WebBrowser.openAuthSessionAsync() instead, which has nothing to do with the deprecated auth proxy.we’re working on cleaning this all up for sdk 49
I spoke too soon. The solutions above work for starting the login flow but Android fails to return back to the app after login. I dug a little further and it seems that the actual issue resides in the
Linking.isExpoHost()function. On SDK 44, this function returns true for us under Expo Go but on SDK 45 it returns false. This seems to be related to movingConstants.manifestin SDK 44. Below is an updated patch we use withpatch-packagethat works for us.However, there’s a good chance that our upgrade path left us with some incorrect config somewhere. Here’s our
app.json: