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

325
Visualizações
How to turn anonymous user to permanent If an anonymous user confirmed his email?

Is it possible to have a non-anonymous user? I want to have a passwordless email only signin, the user receives an email and confirm his email. Then I want to toggle isAnonymous to false.

My code:

const { user } = await signInAnonymously(auth)
await updateEmail(user, email)
await sendEmailVerification(user)
setInterval(() => auth.currentUser.reload(), 2000)

As you can see the user verified his email but still isAnonymous

Edit

Not possible, the user won't be able to sign in. Every time the user tries to sign in he will create a new anonymous user which when updating the user (await updateEmail(user, email)) will result in auth/email-already-in-use.

Needs Firebase to implement a true passwordless way.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to change your authentication mechanism here.

First, you need to create a custom Endpoint to check the user's email address on the backend and in response the backend will send firebase custom token using Firebase admin SDK. This is a JWT token which will be used on the frontend for authenticating with firebase.

const uid = 'user-email';
getAuth()
    .createCustomToken(uid)
    .then((customToken) => {
        // Send token back to client
     })
    .catch((error) => {
        console.log('Error creating custom token:', error);
    });

Secondly, on the frontend your application will authenticate with firebase using the following Firebase Client method.

firebase.auth().signInWithCustomToken(token)
about 4 years ago · Juan Pablo Isaza 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
Recomende algumas ofertas para mim
Preciso de ajuda