supabase-flutter icon indicating copy to clipboard operation
supabase-flutter copied to clipboard

signInWithOAuth with google didn't trigger Supabase.instance.client.auth.onAuthStateChange callback

Open ts-lawrence opened this issue 3 years ago • 2 comments

Hi Supabase team,

I'm testing with iPhone 15 iOS 17.

I'm using the below code block to try to login with google in an in-app webview. The codes are as follows, then it won't trigger Supabase.instance.client.auth.onAuthStateChange

final result = await supabase.auth.signInWithOAuth(
    Provider.google,
    authScreenLaunchMode: LaunchMode.inAppWebView,
    context: context,
    queryParams: {
      'access_type': 'offline',
      'prompt': 'consent',
    },
  );

if remove parameter "context" and change it to as follows. Supabase.instance.client.auth.onAuthStateChange get triggered, but the webview won't be dismissed automatically.

final result = await supabase.auth.signInWithOAuth(
    Provider.google,
    authScreenLaunchMode: LaunchMode.inAppWebView,
    queryParams: {
      'access_type': 'offline',
      'prompt': 'consent',
    },
  );

If remove parameter "queryParams", then the in-app webview won't even be presented. Even though I already called auth.signOut(scope: SignOutScope.global).

final result = await supabase.auth.signInWithOAuth(
    Provider.google,
    authScreenLaunchMode: LaunchMode.inAppWebView,
    context: context,
  );

Moreover, if I pass parameter "context", the in-app webview is different style from the one without "context". with parameter "context": image without parameter "context": image

Currently, I have no choice but to use external webview for login, which is really not a good user experience for our uses. Could you help on this? Thank you

ts-lawrence avatar Oct 11 '23 08:10 ts-lawrence

This issue has been inactive for 180 days. It will be automatically closed in 30 days if there is no further activity.

If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!

github-actions[bot] avatar Mar 08 '26 00:03 github-actions[bot]

This issue was automatically closed due to inactivity.

If you believe this is still relevant, feel free to reopen it or create a new issue with updated information.

github-actions[bot] avatar Apr 12 '26 00:04 github-actions[bot]