Skip to main content

Sign In with Email and Password

Follow this guide to sign in users with email and password.

The email and password sign-in method is enabled by default for all Nhost projects.

Sign Up

Users must first sign up to be able to sign in with Email and Password.

Example: Sign up users using the Nhost JavaScript client.

await nhost.auth.signUp({
email: '',
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

Once a user has been signed up (and optionally verified), you can sign them in.

Example: Sign in users using the Nhost JavaScript client.

await nhost.auth.signIn({
email: '',
password: 'secret-password'

Verified Emails

You can decide if only verified emails should be able to sign in or not. Modify the Only allow users with verified emails to sign in. setting in the Authentication Settings section under Users in your Nhost project.

An email-verification email is automatically sent to the user during sign-up if your project only allows to sign in users with verified emails. You can also manually send the verification email to the user using nhost.auth.sendVerificationEmail().