auth icon indicating copy to clipboard operation
auth copied to clipboard

linkIdentity errors out if the account already exists

Open xinha-sh opened this issue 1 year ago • 1 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When linking an anonymous account with an existing verified account, it errors out. Instead, it should link the anonymous account.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Sign up an user using any of the OAuth provider. Logout
  2. Sign up an anonymous user
  3. Try to link anonymous user with oAuth provider used in step 1
  4. See error

Expected behavior

Even if the account is already registered, anonymous account should get linked with them.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Usecase: An e-commerce platform which lets users add products to cart. The platform is accessible via both web and app. The user has already registered using web, they are new to app. On app they add products and at time of checkout need to sign in. When they try to use their previously registered e-mail id or oauth provider it errors out.

xinha-sh avatar Sep 04 '24 01:09 xinha-sh

IMO this is not a bug, but a nice new feature request. However, I think it should be optional/configurable as it could mess with existing accounts.

oberbeck avatar Sep 07 '24 11:09 oberbeck