Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

749
Visualizações
Uncaught (in promise) FirebaseError: Firebase: Error (auth/account-exists-with-different-credential)

I'm building an app with react and firebase, this app contain firebase auth.

The user switch between Google/Github Login.

Google login is working fine, but when I login with github it show me this error:

Uncaught (in promise) FirebaseError: Firebase: Error (auth/account-exists-with-different-credential).
    at createErrorInternal (assert.ts:122:1)
    at _createError (assert.ts:83:1)
    at _makeTaggedError (index.ts:261:1)
    at _performFetchWithErrorHandling (index.ts:146:1)
    at async _performSignInRequest (index.ts:191:1)
    at async _signInWithCredential (credential.ts:37:1)
    at async PopupOperation.onAuthEvent (abstract_popup_redirect_operation.ts:102:1)

My Code:

const googleProvider = new GoogleAuthProvider();
const githubProvider = new GithubAuthProvider();

const [{ user }, dispatch] = useStateValue();

const loginWithGoogle = async () => {
  const {
    user: { refreshToken, providerData },
  } = await signInWithPopup(auth, googleProvider);
  dispatch({
    type: actionType.SET_USER,
    user: providerData[0],
  });
  localStorage.setItem("user", JSON.stringify(providerData[0]));
  setIsOpen(false);
};

const loginWithGithub = async () => {
  const {
    user: { refreshToken, providerData },
  } = await signInWithPopup(auth, githubProvider);
  dispatch({
    type: actionType.SET_USER,
    user: providerData[0],
  });
  localStorage.setItem("user", JSON.stringify(providerData[0]));
  setIsOpen(false);
};
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This is (likely) due to the fact that the two accounts share an email address, so Firebase considers them the same user. See this answer for more info. Docs here.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Assistente virtual