supabase-community / supabase-kt

A Kotlin Multiplatform Client for Supabase.
https://supabase.com/docs/reference/kotlin/introduction
MIT License
423 stars 38 forks source link

[Bug]: Error flow_state_not_found In Google OAuth #795

Open Shabinder opened 5 days ago

Shabinder commented 5 days ago

General Info

Version(s)

3.0.1

Kotlin Target(s) and their respective versions

JVM 17

What happened? (include your code)

message=Auth API error: flow_state_not_found, cause=io.github.jan.supabase.auth.exception.AuthRestException: invalid flow state, no valid flow state found

Google Oauth is failing for some users, this is not reproducible at my end. I am deeplinking the user back to the app and then import session from that.

I use

Steps To Reproduce (optional)

No response

Relevant log output (optional)

No response

jan-tennert commented 4 days ago

Just to confirm, you are not using supabase.handleDeeplinks()?

Shabinder commented 4 days ago

No, I don't think that is a common sourceSet API, However the code I am using is inspired from that only.

jan-tennert commented 4 days ago

Yea, I'm just asking because supabase.handleDeeplinks() also calls exchangeCodeForSession which could interfere. No idea though, never seen that error, probably related to https://github.com/supabase/auth/issues/1341. Maybe a (self-hosted) issue occurring on some browsers (=hardly reproducable)?

Shabinder commented 4 days ago

It is very rare but consistent for those facing this. Finding steps to this will be a pain. :(

jan-tennert commented 4 days ago

Did you take a look at this discussion https://github.com/orgs/supabase/discussions/16743? Specifically this comment. But I think you can get more help creating an issue in supabase/auth or in supabase discussions

Shabinder commented 4 days ago

I did, the supabase hosted configuration is I believe mostly correct, since for majority of users, including me, the oAuth is working flawlessly, but only a few rare users are facing this, which makes this much more harder to diagnose...