Skip to main content

Sign In with Email and Password

The Email and Password sign-in method is always enabled for all Nhost projects.

Sign Up

Users must first sign up to be able to sign in.

Example: Sign up users using the Nhost JavaScript client.

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

If you've turned on email verification in your project's Authentication Settings, a user will be sent a verification email upon signup. The user must click the verification link in the email before they can sign in.

Sign In

After the user has successfully signed up, they can sign in.

Example: Sign in users using the Nhost JavaScript client.

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

Email Verification

If you want to require users to verify their email before they can sign in, you can enable this under Settings -> Sign-In Methods -> Email and Password by checking the Require Verified Emails checkbox.

If Require Verified Emails is enabled, users automatically get a verification email when they sign up. The user must click the verification link in the email before they can sign in. It's possible to edit the "email-verify" email template.

It's possible to manually send a verification email to the user using nhost.auth.sendVerificationEmail().