signInWithPassword()
Log in an existing user with an email and password or phone and password.
1const { data, error } = await supabase.auth.signInWithPassword({
2 email: 'example@email.com',
3 password: 'example-password',
4})
Parameters#
SignInWithPasswordCredentialsrequired
|reflection
reflection
No description provided.
- required
object
object
No description provided.
phonerequired
string
The user's phone number.
passwordrequired
string
The user's password.
optionsoptional
object
No description provided.
captchaTokenoptional
string
Verification token received when the user completes the captcha on the site.
dataoptional
object
A custom data object to store the user's metadata. This maps to the
auth.users.user_metadata
column.The
data
should be a JSON object that includes user-specific info, such as their first and last name.
Properties
Properties
- required
object
object
No description provided.
passwordrequired
string
The user's password.
emailrequired
string
The user's email address.
optionsoptional
object
No description provided.
captchaTokenoptional
string
Verification token received when the user completes the captcha on the site.
dataoptional
object
A custom data object to store the user's metadata. This maps to the
auth.users.user_metadata
column.The
data
should be a JSON object that includes user-specific info, such as their first and last name.
Properties
Properties
Properties
Notes#
- Requires either an email and password or a phone number and password.
Examples#
Sign in with email and password#
1const { data, error } = await supabase.auth.signInWithPassword({
2 email: 'example@email.com',
3 password: 'example-password',
4})
Sign in with phone and password#
1const { data, error } = await supabase.auth.signInWithPassword({
2 phone: '+13334445555',
3 password: 'some-password',
4})
5
6// After receiving a SMS with a OTP.
7const { data, error } = await supabase.auth.verifyOtp({
8 phone: '+13334445555',
9 token: '123456',
10})