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
- Current User is Not authorized
recreating same Thread
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...