No. Having the identity there with the user id matching is the expected
createOauth2Session gives error 409 Conflict if user already exists but logged out
Votes
1
Replies
24
Participants
Unknown
Messages
25
Does the user have any other sessions active?
Rank 2: Process
Nope, no sessions
Rank 2: Process
not after the deleteSession step.
And the emails match up between the account and the identity?
Let's try this...take note of all the user identity details. Then, delete the user identity, sessions, and the user itself. Then, try to create an oauth2 session again. It should create another identity. Please compare the details between the new identity and the previous one. Do the details match?
Rank 3: Container
i have the same issue. when i got this 409 error, i bypass like that.
WAY 1:
1-open your app
2- login with another user with email and password not oauth2
3- logout user (it clears all cookies and localstorage about user)
4- login with oauth2, it should work
WAY 2:
if you delete directly exact session from appwrite console with related user, it should bypass this error message as well.
Problem: i guess browser saves some local storage and cookies, and appwrite has session with that logged in. While testing it you are trying to create session with oauth2 again and it conflicts with session that is already created. So, please clear all sessions and start to try again
Rank 2: Process
Yup they do
Rank 2: Process
I performed the steps as you mentioned,
The identities of before and after differ by userId.
How about the provider uid?
Rank 2: Process
They match
Okay so google is always returning the same provider user id...then Appwrite shouldn't be trying to create another user or identity 😵💫
Rank 2: Process
Way 1 is out of scope for me, As I do not want emailSession
I have been doing way 2, but still getting conflict.
Rank 2: Process
But it should after the deletion of identity right ?
It doesn't create another identity though if we call on it. I think
Rank 2: Process
It's like after logout, appwrite just tries to create a user regardless of identity
After you deleted and signed in again, a new user and Identity were created. After that, it should lookup the previous user and Identity
It would only do that if it can't match on email/provider user id
Rank 2: Process
Right, I feel however that condition is being disregarded. It is just going on to create a user.
So, again, you only have 1 identity in your project? How many users?
And if you call account.get() before the create oauth2 session, it throws an exception?
Rank 2: Process
Many anonymous users, 4 identities, becuase I used Oauth with 4 different accounts
Can you delete all identities and users?
Rank 2: Process
I do actually, I get the guest scope right after logout and before createOauthSession.
Rank 2: Process
Ok doing it now, Is there a way to bulk delete from appwrite cli ?
Maybe some bash + jq magic