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
- Attach Dart debugger for locally deploye...
Hello there, I was wondering if it is possible to attach debugger to dart function, that I run locally. It would make development much easier :-). Thank you.
- total parameter not working correctly in...
Hello Appwrite team, I'm experiencing issues with the total parameter in the listRows() method (TablesDB) across multiple SDKs. **Issue 1**: Node.js SDK (node...
- Relationship lists aren't showing
In flutter, when I perform a listRows function for my table which contains various relationships in addition to normal data, I am not getting the relationships ...