supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
2.86k stars 220 forks source link

Logging in with multiple identities (same email) does not always work #932

Open shruthigetfreed opened 4 months ago

shruthigetfreed commented 4 months ago

Bug report

Describe the bug

Our application supports logging in with password and google oauth. Based on supabase documentation, some cases of identity linking are supported, while some are not.

To Reproduce

  1. Create an identity user@foo.com and set a password,.
  2. Log in using google oauth as user@foo.com This automatically creates 2 identities for the same user associated with user@foo.com email.

However, I haven't been able to use supabase to swap steps 1 and 2. i.e

  1. Signup using google oauth as user@foo.com successfully.
  2. Try to signup with user@foo.com and set a password. This step fails.

Expected behavior

Is this expected behavior? Any hacks/workarounds I can use to support password+social auth for users without following any order?

tranminhwang commented 1 month ago

I have the same issue. How can i resolve it? @shruthigetfreed

mavrick commented 3 weeks ago

just encountered this myself. used google oauth first, then tried to manually register.

the call works but no session is set and no reference is created in supabase

{
    "id": "10f3b638-c11f-4425-bb22-6de278f3ba1d",
    "aud": "authenticated",
    "role": "",
    "email": "my@email.address",
    "phone": "",
    "confirmation_sent_at": "2024-04-22T12:54:39.589611676Z",
    "app_metadata": {
        "provider": "email",
        "providers": [
            "email"
        ]
    },
    "user_metadata": {},
    "identities": [],
    "created_at": "2024-04-22T12:54:39.589611676Z",
    "updated_at": "2024-04-22T12:54:39.589611676Z",
    "is_anonymous": false
}