
In my flutter app I have 2 oauth sign in buttons (apple and discord).. I noticed that if I sign in first with discord oauth2 then all is fine and a new verified account is created in appwrite. But if I uninstall the app and reinstall it and then if I try to sign in with another oauth2 provider like apple then it does redirect me to apple oauth2 session but once its completed I am logged in from my discord account...

i dont think created sessions for discord could be a problem? since apple account is different than my discord account

btw after re-installing the app (newly opened).. its unable to detect anything from account.get()
hence redirected to login screen.. so idk why later it just logs me in with my earlier account (i.e discord)

_ _ point to note - if i delete the discord session from appwrite auth console and restart the app then apple oauth2 session does create a new session with apple account

are the emails the same in discord and apple?

nope

actually...nvm this is sort of expected. the browser still has the appwrite session. that's why a new account isn't created

oh welp maybe smth we can do so user knows what to do.. would instructing them to clear browser cache/ cookies work?

maybe delete the old session or clear browser data (cookies). clearing cache won't help

but how will i know as a developer which session to delete since await account.get()
doesnt detect an account on re installing

one more question whats wrong in changing this behavior like if user is trying to create a new account then appwrite by itself deleting any old existing session and creating new session with new account?

you might have to do something server-side 🤷🏼♂️

it's behaving as intended for cases like use has an anonymous session and then they create an oauth2 session to convert their anonymous account to one with email

i see i understand i have no knowledge of how things work behind the scenes but changing the behaviour depending on what sort of session has been initiated by user might improve the situation?

but either way thanks for the help

appreciate it 👍

[CLOSED] Auth signs in with old session account after OAuth2 Session
Recommended threads
- 503 Timeout when Updating or Upserting D...
Hey I’m running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
- Hola equipo de soporte,
Hola equipo de soporte, Estoy desarrollando una Function en Appwrite Cloud con Node.js 22 y el siguiente package.json: { "name": "upload-whitelist", "type"...
- Sites 30MB limit from GitHub
I’m deploying a site from github as Other type on the Hobby plan. It is actually a Flutter web app but it’s in a subdirectory with the root being an html landin...
