【发布时间】:2017-01-09 19:40:54
【问题描述】:
我想从我的应用中禁用 Firebase 用户,但 Firebase 文档只允许我选择删除用户。
我认为解决方案就像创建用户前: https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=[YourKey]
但没有关于此的文档。
【问题讨论】:
标签: firebase firebase-authentication
我想从我的应用中禁用 Firebase 用户,但 Firebase 文档只允许我选择删除用户。
我认为解决方案就像创建用户前: https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=[YourKey]
但没有关于此的文档。
【问题讨论】:
标签: firebase firebase-authentication
Firebase Admin SDK 有一个禁用用户的选项。
参见this the documentation,其中包含此代码示例:
admin.auth().updateUser(uid, { email: "modifiedUser@example.com", emailVerified: true, password: "newPassword", displayName: "Jane Doe", photoURL: "http://www.example.com/12345678/photo.png", disabled: true }) .then(function(userRecord) { console.log("Successfully updated user", userRecord.toJSON()); }) .catch(function(error) { console.log("Error updating user:", error); });
【讨论】: