Hi Supabase Community,
I'm facing a persistent AuthApiException: code challenge does not match previously saved code verifier error in my Flutter app's email verification deep link flow. This prevents automatic user login.
Crucially:
My colleague uses the exact same code and setup and successfully auto-logs in every time.
I have also seen it work successfully on my machine in the past, but it's now consistently failing.
This suggests an intermittent environmental/state issue, not a code bug.
My Setup Highlights:
supabase_flutter: ^2.9.0 (latest)
Deep Link Activation: App launches correctly via shu-dong://callback/register?code=... (verified in logs). The code is received.
Key Supabase.initialize params:
authFlowType: AuthFlowType.pkce
redirectTo: 'shu-dong://callback/' (within AuthClientOptions / auth)
localStorage: SupabaseLocalStorage()
Native: AndroidManifest.xml correctly configured for shu-dong://callback/.
Logic: /register route calls supabase.auth.exchangeCodeForSession(code).
Backend Logs: POST /auth/v1/token shows 400 Bad Request with x_sb_error_code: "bad_code_verifier".
Troubleshooting: I've performed thorough cleaning (flutter clean, pub cache repair, adb pm clear) and tested with new users.
Could this intermittency be due to a subtle network issue, device/emulator state, or a caching problem beyond standard cleaning? Any insights into diagnosing this intermittent code challenge mismatch would be greatly appreciated!