[英]how do I add displayName to my user using Pyrebase
I am using Pyrebase in order to work with Firebase on my project.我正在使用 Pyrebase 以便在我的项目中使用 Firebase。 I have been able to successfully create a user using email and password.我已经能够使用 email 和密码成功创建用户。 The user object has a field called displayName
.用户 object 有一个名为displayName
的字段。 How do I enter a value in this at the time of creation?创建时如何在其中输入值?
From what I can see in the Auth
implementation of the repo, it does not provide functionality to set the user's display name.从我在 repo 的Auth
实现中可以看到,它不提供设置用户显示名称的功能。
The underlying REST API that Pyrebase is built on does have a method to set the user's account info (including their display name), so it would be possible to include this in Pyrebase. Pyrebase 所基于的底层 REST API确实具有设置用户帐户信息(包括他们的显示名称)的方法,因此可以将其包含在 Pyrebase 中。 I recommend filing a feature request on the Github repo.我建议在 Github 存储库上提交功能请求。
user=auth.sign_in_with_email_and_password(email,password)
info = auth.get_account_info(user['idToken'])
displayname = info['users'][0]['displayName']
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.