`prepPKCERedirectURL`drops `//` from custom scheme URIs, corrupting PKCE auth code on iOS (`%23`)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ios, javascript, react-native
- Domain
- authentication, mobile
Research direction
Trace prepPKCERedirectURL through the PKCE redirect flow, starting with the myapp:// reproduction and comparing it with makeRedirectUri() and WebBrowser.openAuthSessionAsync. Confirm completion when result.url preserves myapp://?code=CODE without the trailing %23 and exchangeCodeForSession no longer reports “No valid flow state found”.
Written by the indexing model from the issue text.
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When using PKCE OAuth from on iOS with a custom URL scheme that has no path (ex. myapp://), the redirect URL returned to the app contains a corrupted auth code a trailing %23 (URL-encoded #). This causes exchangeCode ForSession to fail with "No valid flow state found".
To Reproduce
- Create an Expo React Native app targeting iOS
- Use
makeRedirectUri()with no arguments → returnsmyapp:// - Call
supabase.auth.signInWithOAuth({ provider: 'google', options: { redirectTo: 'myapp://', skipBrowserRedirect: true } }) - Open the auth URL with
WebBrowser.openAuthSessionAsync - Complete Google sign-in
- Observe
result.urlcontainsmyapp:?code=CODE%23instead ofmyapp://?code=CODE exchangeCodeForSessionfails with "No valid flow state found"
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [e.g. macOS, Windows]
- Browser (if applies) [e.g. chrome, safari]
- Version of supabase-js: [e.g. 6.0.2]
- Version of Node.js: [e.g. 10.10.0]
Additional context
Add any other context about the problem here.
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 764
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/auth
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100