Hi guys I have a problem with reauthentication. I'm providing an email from currentUser state and password from popup window.
This is how reauth function looks now:
async function reauthenticate(password: string) {
try {
if (currentUser) {
console.log(currentUser?.email);
const credential = firebase.auth.EmailAuthProvider.credential(
currentUser.email!,
password,
);
console.log(credential);
await currentUser.reauthenticateWithCredential(credential);
return true;
}
} catch (error) {
console.log(error.message);
throw 'Please try again';
}
}
And this is output from the console. I have no idea why I have a "The email address is badly formatted" error. The provided email doesn't have white spaces.
Any ideas? Thanks :)