0
0
Supabasecloud~10 mins

Email/password authentication in Supabase - Interactive Code Practice

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

Complete 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'
AsignUp
BsignInWithPassword
CsignOut
DresetPasswordForEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using signInWithPassword instead of signUp to create a new user.
Trying to reset password instead of signing up.
2fill in blank
medium

Complete 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'
AsignInWithPassword
BsignUp
CsignOut
DsendMagicLinkEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using signUp instead of signInWithPassword to log in.
Using sendMagicLinkEmail which is for passwordless login.
3fill in blank
hard

Fix 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'
AsignInWithPassword
BsignUp
CsignOut
DresetPasswordForEmail
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.
4fill in blank
hard

Fill 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'
AresetPasswordForEmail
BsignOut
CuserEmail
DsignInWithPassword
Attempts:
3 left
💡 Hint
Common Mistakes
Using signInWithPassword or signOut instead of resetPasswordForEmail.
Passing wrong variable for email.
5fill in blank
hard

Fill 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'
AupdateUser
BnewPassword
Cdata.user.email
DsignOut
Attempts:
3 left
💡 Hint
Common Mistakes
Using signOut instead of updateUser.
Logging wrong user info.