可以在不使用firebase身份验证API登录的情况下获取用户ID"电子邮件/密码方法"?
假设一个函数将电子邮件作为param并返回firebase userId
getId(email){
//this is an example
return this.firebase.auth.getId(email); // this method is not firebase method i wrote just for explication
}
感谢。
答案 0 :(得分:0)
您可以使用Firebase Admin SDK。来自official documentation
admin.auth().getUserByEmail(email)
.then(function(userRecord) {
// See the tables above for the contents of userRecord
console.log("Successfully fetched user data:", userRecord.toJSON());
})
.catch(function(error) {
console.log("Error fetching user data:", error);
});
另请参阅:Firebase Authentication Service - lookup uid from email without login