Back

user_email_already_exists when creating a new Apple session

  • 0
  • Self Hosted
  • Flutter
  • Accounts
fernandoxlr
30 Sep, 2023, 13:32

Ok, I can see the provider now, it's apple

TL;DR
Users are experiencing an issue where they are unable to create a new Apple session due to the error 'user_email_already_exists'. One user attempted to solve the issue by deleting the user from the database. Another user found that the issue was caused by an existing identity for a different user using a different OAuth provider. There is no specific solution mentioned in the thread.
fernandoxlr
30 Sep, 2023, 13:32

provider| providerUid | providerEmail apple β”‚ 000588.0000000000000000000.2355 β”‚ my-email@icloud.com

Drake
30 Sep, 2023, 17:13

So is this tied to a different user?

Drake
30 Sep, 2023, 17:16

The way it works now is if there's no session, and you create a new oauth session, you'll get logged in to the linked account based on that identities data.

If you have a session and this is a new oauth provider email/uid, it will create a new identity.

If you have a session but the oauth provider email/uid is already linked to another account, you'll get an error

fernandoxlr
30 Sep, 2023, 17:20

I have cleaned all sessions yesterday, so my sessions are empty. I try to login using the same provider (apple) and email, but I get that error.

fernandoxlr
30 Sep, 2023, 17:20

I think it should just login back to my account.

fernandoxlr
30 Sep, 2023, 17:21

Same provider, same email, I didn't change any configuration for Apple login in the console.

Drake
30 Sep, 2023, 17:21

It should, yes 🧐

fernandoxlr
30 Sep, 2023, 17:24

If you need some data to investigate, I can send you in private message.

fernandoxlr
30 Sep, 2023, 23:10

I've created a new simulator, everything is clean, and yet I can't login using that account. So it doesn't have any connection to the cookies or already connected account.

Drake
30 Sep, 2023, 23:17

I wonder if apple is generating a new email, but using the same user id

fernandoxlr
30 Sep, 2023, 23:23

It's possible. Because users have the option to use private email and the actually email, maybe I've created with real email and now I am login with the private one or vice versa (I don't have the option anymore). Is there a way to debug what e-mail is being sent?

Drake
30 Sep, 2023, 23:39

Not really... Unless you test it on a local appwrite instance and dump the response from Apple

fernandoxlr
30 Sep, 2023, 23:50

I will delete my account and try again to see in which account I'll be logged in. Tomorrow I'll give you feedback.

fernandoxlr
2 Oct, 2023, 19:59

I don't know how it happened, but in my AppWrite database, I had both my Gmail and iCloud accounts (two separate accounts). After I deleted the iCloud account from the database and tried to log back into my iCloud account, it was logging into my Gmail account. So when I got the list of identities of that account, it was listed the gmail and icloud identities.

fernandoxlr
2 Oct, 2023, 20:03

I solved it by deleting the identity using the id, now I can log back into my icloud account as a separate account. Somehow, I could attach my icloud account to my gmail account even with a previously created account already in the database.

Drake
4 Oct, 2023, 02:18

Was the email on the identity the same as the email on the other account?

Drake
4 Oct, 2023, 02:19

After deleting and recreating the identity, did the email of the new identity match the previous deleted identity?

fernandoxlr
4 Oct, 2023, 10:43

The same email, identity apple. If you are asking for ids I didn't take notes

fernandoxlr
4 Oct, 2023, 12:55

and yes, the new account now has exactly the same e-mail as the old account that I couldn't login

Drake
4 Oct, 2023, 16:30

Somehow, I could attach my icloud account to my gmail account even with a previously created account already in the database.

So weird...that shouldn't happen. I'll have to troubleshoot this some more..

Infinil
1 Nov, 2023, 17:32

@fernandoxlr facing similar issue

Infinil
1 Nov, 2023, 17:32

did u find any solution

Infinil
1 Nov, 2023, 17:43

nvm i think its because of an existing identity for diff user and i am using another oauth provider here

fernandoxlr
1 Nov, 2023, 17:50

Unfortunately I didn't find the real cause. I solved by deleting the user from database. In my case I was using the same oauth provider

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more