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

Ability to always choose a Google account from a list #272

Closed
JohnBuchmann opened this issue Apr 25, 2023 · 6 comments
Closed

Ability to always choose a Google account from a list #272

JohnBuchmann opened this issue Apr 25, 2023 · 6 comments

Comments

@JohnBuchmann
Copy link

JohnBuchmann commented Apr 25, 2023

If you log in with one Google account, you are literally not able to switch to another Google account. When logging in, this plugin will use the account you last authenticated with, and you have no way to override this.

Interestingly, on the web with Firefox (only), it will always prompt you to choose a Google account. But on other browsers, and on Android (I also assume iOS) you cannot. This is a real problem since the user will be forced to forever use only one Google account login. Even if you uninstall and reinstall the mobile app it will auto login with the last account used.

There is a similar post from a couple years ago, but the solution said to signOut() before signing in. But that doesn't solve this issue. Thx!

@tarangshah19
Copy link

any solution you found?

@JohnBuchmann
Copy link
Author

No solution yet. But I ended up reverting from Android/iOS to just PWA. This is because on Android things get just way too sluggish. It appears to be a Capacitor with webView issue: ionic-team/capacitor#3899
So now as a web app/PWA I am back to using standard google login (I'm using Angular Firebase UI library to make it even easier) and I have no need for CapacitorGoogleAuth

@tarangshah19
Copy link

any other npm dependancy i am usisng vue js capacitor

mirko77 added a commit to epicollect5/CapacitorGoogleAuth that referenced this issue Jun 19, 2023
@aljacket
Copy link

I have added the GoogleAuth.signOut() before the signIn and it worked. on Android now alway ask for an account if I press the google login button.

using vite, capacitor 4, vue 3

@mirko77
Copy link
Contributor

mirko77 commented Jun 21, 2023

@aljacket it depends on the device and network speed as the current Android code is not correct.
I opened a pull request with the fix #288

@BrayanAngaritaR
Copy link

any solution you found?

@tarangshah19

I think this is the best solution out there for now.

Just log out before logging back in. For example:

async function signInWithGoogle() {
    await GoogleAuth. signOut();
    const user = await GoogleAuth.signIn();
    authStore. handleLoginGoogle(user); //Optional for store
}

I tried it on iOS and it works perfectly :)

I'm using Vue 3 and Ionic 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants