0

firebase 클라우드 인증을 사용하여 간단한 웹 포털을 만들고 있습니다. 한 명의 사용자는 다른 일반 사용자를 생성하고 자격 증명을 일반 사용자에게 넘겨 줄 관리자입니다.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를 버전에서만 사용할 수 있습니다.