Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to sign up a user with email and password.
Supabase
const { data, error } = await supabase.auth.[1]({ email, password }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using signInWithPassword instead of signUp to create a new user.
Trying to reset password instead of signing up.
✗ Incorrect
The signUp method creates a new user with email and password.
2fill in blank
mediumComplete the code to sign in a user with email and password.
Supabase
const { data, error } = await supabase.auth.[1]({ email, password }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using signUp instead of signInWithPassword to log in.
Using sendMagicLinkEmail which is for passwordless login.
✗ Incorrect
The signInWithPassword method signs in an existing user using email and password.
3fill in blank
hardFix the error in the code to sign out the current user.
Supabase
const { error } = await supabase.auth.[1](); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to sign in or sign up instead of signing out.
Passing parameters to signOut which does not accept any.
✗ Incorrect
The signOut method logs out the current user.
4fill in blank
hardFill both blanks to reset a user's password via email.
Supabase
const { data, error } = await supabase.auth.[1]({ email: [2] }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using signInWithPassword or signOut instead of resetPasswordForEmail.
Passing wrong variable for email.
✗ Incorrect
The resetPasswordForEmail method sends a password reset email to the user's email address.
5fill in blank
hardFill all three blanks to update the user's password after sign in.
Supabase
const { data, error } = await supabase.auth.[1]({ password: [2] });
if (!error) {
console.log('Password updated for user:', [3]);
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using signOut instead of updateUser.
Logging wrong user info.
✗ Incorrect
The updateUser method updates user details like password. The new password is passed as password. The user's email is accessed from data.user.email.