TL;DR
OAuth in Expo returns to your app through a custom scheme like myapp:// .
Three things must agree: scheme in app.json , the redirectTo from makeRedirectUri() , and Supabase's Redirect URLs allowlist.
makeRedirectUri() returns exp://... in Expo Go and myapp://... in a dev build. Allowlist the one you actually use.
Changing scheme needs a rebuild. An OTA update won't do it.
Debug step one: console.log(makeRedirectUri()) on the device.
The setup
app.json :
{ "expo" : { "scheme" : "myapp" } }
Enter fullscreen mode
Exit fullscreen mode
Supabase dashboard, Authentication > URL Configuration > Redirect URLs:
myapp://**
Enter fullscreen mode
Exit fullscreen mode
( * stays inside one path segment, ** matches anything including / .)
The code
npx expo install expo-auth-session expo-web-browser expo-linking
Enter fullscreen mode
Exit fullscreen mode
import { makeRedirectUri } from ' expo-auth-session ' ; import * as QueryParams from ' expo-auth-session/build/QueryParams ' ; import * as…