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

324
Visualizações
Firebase Auth- Not adding users after signup

I am trying to add users with email and password function in Firebase but the information is not added once the sign up button is clicked. I have inserted the block of code I've written to perform this action. I'm not sure what I'm missing.The user information does not appear in the console and there is no error message. All other data that is entered works, the authentication part is the only thing that is not working correctly.

  
  // signing new users up
    const signupForm = document.querySelector('.signup');
    signupForm.addEventListener('submit', (e) => {
      e.preventDefault();
  
      const email = signupForm.email.value;
      const password = signupForm.password.value;
  
      createUserWithEmailAndPassword(auth, email, password)
        .then((cred) => {
          // console.log('user created:', cred.user);
          signupForm.reset();
        })
        .catch((err) => {
          // console.log(err.message);
        });
  
      // logging in and out
      const logoutButton = document.querySelector('.logout');
      logoutButton.addEventListener('click', () => {
        signOut(auth)
          .then(() => {
            alert('user signed out');
          })
          .catch((err) => {
            console.log(err.message);
          });
      });
  
      const loginForm = document.querySelector('.login');
      loginForm.addEventListener('submit', (e) => {
        e.preventDefault();
  
        const email = loginForm.email.value;
        const password = loginForm.password.value;
  
        signInWithEmailAndPassword(auth, email, password)
          .then((cred) => {
            console.log('user logged in:', cred.user);
            loginForm.reset();
          })
          .catch((err) => {
            console.log(err.message);
          });```
about 4 years ago · Juan Pablo Isaza
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
Recomende algumas ofertas para mim
Preciso de ajuda