Skip to content

Sign In with Email and Password

email password login sign up register authentication credentials

Sign In with Email and Password is enabled by default on all projects.

To Sign Up a new user, use signUp with a valid email and password.

await nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})

After a user is registered, and optionally verified, it is able to Sign In.

await nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})

By default, newly registered users will receive an email with a verification link they must follow before they can Sign In.

To change this setting, navigate to Settings -> Sign-In Methods -> Email and Password and set Require Verified Emails.

It is possible to manually send the verification email to a user with sendVerificationEmail().

await nhost.auth.sendVerificationEmail({
email: 'joe@example.com',
password: 'secret-password'
})