0
0
Firebasecloud~10 mins

Email/password login in Firebase - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize Firebase Authentication.

Firebase
const auth = firebase.auth().[1]();
Drag options to blanks, or click blank then click option'
AgetAuth
BinitializeAuth
CauthInit
DstartAuth
Attempts:
3 left
💡 Hint
Common Mistakes
Using a function name that does not exist in Firebase Auth.
Trying to call auth as a property instead of a function.
2fill in blank
medium

Complete the code to sign in a user with email and password.

Firebase
auth.[1](email, password).then(userCredential => {
  // Signed in
}).catch(error => {
  // Handle error
});
Drag options to blanks, or click blank then click option'
AsignInWithEmailAndPassword
BloginWithEmail
CauthenticateUser
DsignInUser
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names that do not exist.
Confusing sign-in with sign-up methods.
3fill in blank
hard

Fix the error in the code to create a new user with email and password.

Firebase
auth.[1](email, password).then(userCredential => {
  // User created
}).catch(error => {
  // Handle error
});
Drag options to blanks, or click blank then click option'
AregisterUser
BcreateUserWithEmailAndPassword
CnewUserWithEmail
DaddUserWithPassword
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent method names.
Mixing sign-in and sign-up method names.
4fill in blank
hard

Fill both blanks to send a password reset email to the user.

Firebase
auth.[1](auth, [2]).then(() => {
  // Email sent
}).catch(error => {
  // Handle error
});
Drag options to blanks, or click blank then click option'
AsendPasswordResetEmail
Bemail
CresetEmail
DsendResetEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names.
Passing wrong arguments to the method.
5fill in blank
hard

Fill all three blanks to update the user's password after login.

Firebase
const user = auth.currentUser;
update[1](user, [2]).then(() => {
  console.log('[3]');
}).catch(error => {
  // Handle error
});
Drag options to blanks, or click blank then click option'
APassword
BnewPassword
CPassword updated successfully
DEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong function names.
Confusing email with password update.