supabase-community/flutter-auth-ui

If signed in with Google provider, signOut does not sign out of the provider

Opened this issue ยท 5 comments

Bug report

Describe the bug

When signed in with Google as the provider on an Android device, signOut() ends the Supabase session but does not log out from the provider as well.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Sign in setup

SupaSocialsAuth(
	socialProviders: const [OAuthProvider.google],
	nativeGoogleAuthConfig: const NativeGoogleAuthConfig(webClientId: '...'),
	onSuccess: (Session session) {},
)

Sign out action
Supabase.instance.client.auth.signOut()

  1. On first sign-in on an Android device, an account chooser is displayed
  2. Select an account from the list and login
  3. Sign out and return to the login screen
  4. Sign in again. This time the login completes without presenting the account chooser

Expected behavior

On sign-in after a sign-out, the account chooser should be displayed again.

System information

  • OS: Android 14
  • supabase_auth_ui: 0.4.3

Isn't this typical behaviour?

I'm coming from Firebase so I'll compare to that.
FirebaseAuth.instance.signOut() terminates the Firebase session but does not log out of the provider on the device, same as what is currently possible with Supabase.
The firebase_ui_auth API has FirebaseUIAuth.signOut() which also signs out of the provider. I would like to see an equivalent of that in this package.

@dshukertjr thoughts?

Sure, seems like a fair feature to have ๐Ÿ‘

I have the same issue, i added this to fix it:

                onTap: () async {
                  await Supabase.instance.client.auth.signOut().then((value) {
                    _googleSignIn.signOut();
                    GoRouter.of(context).go('/login');
                  });
                },

But yea it seems more logical to have a provider sign out when using signOut