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

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

Open
ts-lawrence opened this issue Oct 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ts-lawrence
Copy link

ts-lawrence commented Oct 11, 2023

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 ts-lawrence added the bug Something isn't working label Oct 11, 2023
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

1 participant