
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
- Flutter OAuth2 Google does not return to...
When the flow starts, the browser opens, I select an account, and it keeps showing: """ Page not found The page you're looking for doesn't exist. `general_rout...
- Redirect URL sends HTTP instead of HTTPS...
I am not sure since when this issue is present, but my Google and Apple redirect URI are no longer pointing to the HTTPS redirect URI when I try to use OAuth. ...
- Failing to run document operations on sd...
Could someone point me in the right direction I'm going in cirlces. I have a problem with sdks and my self-hosted server in production (for ~3 years) I have bee...
