Here is a piece of firebase code:-
async reAuthenticateUser({ email, password }) {
const user = await this.afAuth.currentUser;
const credential = (await this.afAuth.signInWithEmailAndPassword(email, password)).credential;
user.reauthenticateWithCredential(credential);
}
I am using ionic 5+/Angular and AngularFireAuth. Basically to delete a user we need to reauthenticate the user using the above reuaunthenticateWithCredential Method. I am confused as to what is credential object that needs to be fed. I tried resigning and getting the new credential and feeding to the method for reauthentication but it fails and gives me error :-
"reauthenticateWithCredential failed: First argument "credential" must be a valid credential."
Please Guide , thank you.