Problem
Firebase force overwrites previous authentication provider when we sign-up using Google OAuth.
Precondition
- Both GitHub account and Google one are the same email.
- Disallow multiple accounts with the same email address
Expected Behavior
- Sign-up using GitHub OAuth
- A new account (ACCOUNT_1) is created on Firebase Auth
- Sign-out
- Sign-up using Google OAuth, "auth/account-exists-with-different-credential" error occurs.
Actual
- Sign-up using GitHub OAuth
- A new account (ACCOUNT_1) is created on Firebase Auth
- Sign-out
- Sign-up using Google OAuth
- ACCOUNT_1 is overwritten by Google OAuth provider on Firebase.
- Sign-in using GitHub OAuth, "auth/account-exists-with-different-credential" error occurs.
What I tried
- When a new account is created first time, I force updated emailVerified = True using Cloud Functions.
I saw the bellow article:
In my understanding, Google OAuth process only overwrites an account with non-verified email.