Back

Cannot sign in to multiple google account in Flutter

  • 0
  • Self Hosted
  • Flutter
SushilGhorasaini
22 Nov, 2023, 05:54

Once logged in with an account, if i log out and try to log in with another google account, i get logged in with the previous google account insted of new one. Also, there won't be any new user entry in the appwrite console as well.

TL;DR
The user is having trouble signing in to multiple Google accounts in Flutter. There is a suggested solution provided in a GitHub issue that the user should check. The message also advises the user to format their code using backticks for better readability. The user shares the code they are using and explains that when logging out and attempting to log in with a new Google account, they are still logged in with the previous account and no new user entry is created in the appwrite console.
SushilGhorasaini
22 Nov, 2023, 05:54

here is the code i used: try { await _client.createOAuth2Session(provider: 'google'); final currentUser = await _client.get(); logger.i(currentUser.email); await _notificationService.registerDevice(currentUser.$id); return currentUser.toDomain(); } catch (e) { throw const AuthenticationException("Something went wrong"); }

Drake
22 Nov, 2023, 06:10

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.

Drake
22 Nov, 2023, 06:10

sounds like you're running into this: https://github.com/appwrite/appwrite/issues/7021

I suggest you 👍🏼 the issue

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more