2017-05-16 19 views
0

firebaseクラウド認証を使用して簡単なWebポータルを作成しています。 1人のユーザーは、他の通常のユーザーを作成し、資格情報を通常のユーザーに引き渡す管理者です。firebase認証で他のユーザーのパスワードをリセットする方法は?

var newUser = firebase.auth().createUserWithEmailAndPassword(newEmail, newPassword); 

これで、管理者は通常のユーザーのパスワードをリセットする必要があります。

どうすればこの問題を解決できますか?誰でもアイデアを共有できますか?

ありがとうございます!

答えて

0

Admin SDKでupdateUser()を呼び出すことでこれを行うことができます。 this documentation pageからサンプル:

admin.auth().updateUser(uid, { 
    email: "[email protected]", 
    emailVerified: true, 
    password: "newPassword", 
    displayName: "Jane Doe", 
    photoURL: "http://www.example.com/12345678/photo.png", 
    disabled: true 
}) 
    .then(function(userRecord) { 
    // See the UserRecord reference doc for the contents of userRecord. 
    console.log("Successfully updated user", userRecord.toJSON()); 
    }) 
    .catch(function(error) { 
    console.log("Error updating user:", error); 
    }); 

この機能は、現時点では管理SDKのNode.jsのバージョンでのみ使用可能です。

関連する問題