createOauth2Session gives error 409 Conflict if user already exists but logged out
- 1
- Accounts
- Web
- Cloud

No. Having the identity there with the user id matching is the expected

Does the user have any other sessions active?

Nope, no sessions

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?

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

Yup they do

I performed the steps as you mentioned, The identities of before and after differ by userId.

How about the provider uid?

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 😵💫

Way 1 is out of scope for me, As I do not want emailSession I have been doing way 2, but still getting conflict.

But it should after the deletion of identity right ? It doesn't create another identity though if we call on it. I think

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

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?

Many anonymous users, 4 identities, becuase I used Oauth with 4 different accounts

Can you delete all identities and users?

I do actually, I get the guest scope right after logout and before createOauthSession.

Ok doing it now, Is there a way to bulk delete from appwrite cli ?

Maybe some bash + jq magic
Recommended threads
- Database not found
i am getting an error named - database not found . I have logged on yesterday and it was working fine. But today it fails . More clearly i can say, each new day...
- 500 error trying to view database consol...
My project was blocked yesterday for queries missing a custom index. After it was restored, I was able to see the console last evening. But, when I try to acce...
- 404 if I try to access a non-existent bu...
When I try to access my profile_pictures bucket, Appwrite just gives a 404 error. I made it at the beginning of the year and since I created it this has happene...
