reauthenticate method

Future<UserCredential> reauthenticate(
  1. String email,
  2. String password
)

Re-authenticates the current user with their email and password.

Necessary before performing sensitive operations such as deleting an account.

Implementation

Future<UserCredential> reauthenticate(String email, String password) async {
  AuthCredential credential =
      EmailAuthProvider.credential(email: email, password: password);
  return await FirebaseAuth.instance.currentUser!
      .reauthenticateWithCredential(credential);
}