更新Firebase中的用户信息 [英] update user information in firebase

查看:292
本文介绍了更新Firebase中的用户信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在最新版本的 2.0.1 中使用了angularFire,但是我看到有关如何将信息更新为displayName的信息,尝试使用获取用户信息firebase.User ()但是我得到错误getApi我误导quisas如何更新用户创建的信息

I am using angularFire in its latest version 2.0.1, but I see information on how to update information as "displayName" try to obtain user information with firebase.User() but I get error "getApi" I am misguided quisas how to update the information a user created earlier

推荐答案

我找到了解决这个问题的办法。
您可以执行以下操作:

I found a solution for this problem. You can do the following:

var user = firebase.auth().currentUser;
user.updateProfile({
  displayName: vm.form.username
}).then(function(response) {
  //Success
}, function(error) {
  //Error
  console.log(error);
});

这篇关于更新Firebase中的用户信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆