Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error flow_state_not_found In Google OAuth #795

Open
3 tasks done
Shabinder opened this issue Nov 26, 2024 · 6 comments
Open
3 tasks done

[Bug]: Error flow_state_not_found In Google OAuth #795

Shabinder opened this issue Nov 26, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Shabinder
Copy link

General Info

  • I checked for similar bug report
  • I am using the latest version
  • I checked the troubleshooting page for similar problems

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

  • PKCE Flow
  • SelfHosted Instance

The same exact flow is working for most of my users.

Code Snippet:

 override suspend fun importSessionFromCode(code: String): Either<AuthError, UserSession> {
   return catchAllOnIO {
     auth.exchangeCodeForSession(code)
     auth.currentSessionOrNull() ?: throw Exception("No session available.")
   }
 }

Retaled maybe ?
supabase/auth#1341

Steps To Reproduce (optional)

No response

Relevant log output (optional)

No response

@Shabinder Shabinder added the bug Something isn't working label Nov 26, 2024
@jan-tennert
Copy link
Collaborator

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

@Shabinder
Copy link
Author

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

@jan-tennert
Copy link
Collaborator

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

@Shabinder
Copy link
Author

Shabinder commented Nov 27, 2024

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

@jan-tennert
Copy link
Collaborator

jan-tennert commented Nov 27, 2024

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
Copy link
Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants