Complete the code to initialize Firebase Authentication.
const auth = firebase.auth().[1]();The getAuth() function initializes and returns the Firebase Authentication instance.
Complete the code to sign in a user with email and password.
auth.[1](email, password).then(userCredential => { // Signed in }).catch(error => { // Handle error });
The signInWithEmailAndPassword method signs in a user using email and password.
Fix the error in the code to create a new user with email and password.
auth.[1](email, password).then(userCredential => {
// User created
}).catch(error => {
// Handle error
});The correct Firebase method to create a new user with email and password is createUserWithEmailAndPassword.
Fill both blanks to send a password reset email to the user.
auth.[1](auth, [2]).then(() => { // Email sent }).catch(error => { // Handle error });
The method sendPasswordResetEmail sends a reset email. The second blank is the user's email address variable.
Fill all three blanks to update the user's password after login.
const user = auth.currentUser; update[1](user, [2]).then(() => { console.log('[3]'); }).catch(error => { // Handle error });
The function updatePassword updates the user's password. The second blank is the new password variable. The third blank is a success message.