Firebase user update with SDK node

Asked

Viewed 53 times

1

I am trying to update login data of a firebase user using the Node admin sdk. My code looks like this:    

     

var uid = req.body.uid;
var objectUpdate = {
    "displayName": "David Coelho"
};
admin.auth().updateUser(uid, objectUpdate)
    .then(função(userRecord) {
        // var id = userRecord.uid;
        //usersRef.child(id).set(userDatabase (req, res))
        res.status(200).json({
            "return": "Atualizar usuário com sucesso"
        })
    })
    .catch(função(erro) {
            res.status(500).json({
                "return": error
            })
        });

But I cannot update the user. Firebase sends me the following error message:

"Código": "auth / internal-error",
"Mensagem": "Ocorreu um erro interno."

Can someone help me?

  • Your code has a syntax error. The last ); should be });

  • Thank you. I posted wrong here. But the problem persists.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.