简体   繁体   English

连接时更新 firebase 中的用户配置文件

[英]Update user profile in firebase on being connected

Below is the Firebase sample code, where I can update a user after being authenticated.下面是 Firebase 示例代码,我可以在通过身份验证后更新用户。 (var user = firebase.auth (). currentUser;) (var user = firebase.auth().currentUser;)

  var user = firebase.auth().currentUser;

user.updateProfile({
  displayName: "Jane Q. User",
  photoURL: "https://example.com/jane-q-user/profile.jpg"
}).then(function() {
  // Update successful.
}).catch(function(error) {
  // An error happened.
});

I would like to know if it is possible to edit the user without having to be logged in, use the updateProfile function with the user's UID or EMAIL.我想知道是否可以在无需登录的情况下编辑用户,使用带有用户 UID 或 EMAIL 的 updateProfile 函数。

Thanks谢谢

除非用户已登录,否则用户无法成功调用updateProfile 。其他任何事情都将是一个巨大的安全漏洞,因为这意味着互联网上的任何人都可以仅通过 UID 的知识来更新任何配置文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM