Open michaelpomogajko opened 1 year ago
Hey @pragatimodi @Xiaoshouzi-gh do you know if we have any known issues with the providersToUnlink()
API? Thank you!
Hi, any update on this?
Upon initial inspection, it appears that the providersToUnlink
field should be set to ['apple.com', 'google.com']
rather than ['apple.com, google.com']
. Additionally, for email provider, the value should be updated to uid
instead of email
. Enclosed please find the updated payload:
{
providersToUnlink: ['apple.com', 'google.com'],
providerToLink: {
providerId: 'email',
uid: email,
}
Please inform me if this resolves your concern.
Hi @Xiaoshouzi-gh,
thanks for the hint. Silly typo in the providersToUnlink field. I am able to unlink the providers since you've pointed that out.
Nonetheless, the linking is still not working after using the email as the uid for the provider, unfortunately
I'm experiencing this issue as well with twitter.com
Any updates here? Still can't link email provider with firebase-admin
Hi Michael, thanks for reaching out. After digging through the code and Identity Platform API reference, it seems we do not support email/password as a provider (correction - providerId is 'password') to link using the providerToLink field.
However, you can still call the same API to update the email and password.
Your payload should look like this
auth.updateUser(userId, {
email,
password
providersToUnlink: ['apple.com', 'google.com'],
})
Please see identity platform API reference with more detail.
Hi @Xiaoshouzi-gh, thanks for your swift response. In my case, I don't try to link email/password, but only email with magic link. The documentation you provided doesn't mention this.
If it turns out this also doesn't work, then I kindly suggest to update the sdk to throw an error when trying to do so. The current behaviour implies that it's supported
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
I'm trying to link the email provider to a user. Code runs without issues, but applies no changes. Unlinking also not working.
Relevant Code:
Scenario: user is linked to apple and google providers, aim is to unlink those and add email provider instead.
Script exits without issues, changes not applied. User still has apple and google provider but no email provider.