Sign-in

Sign-in pages

Sign in, sign up, password resets and two-factor, ready to use.
The sign-in page: email and password, provider icons, then passkey, sign-in link, email and text codes, single sign-on and guest buttons

The sign-in pages are on by default, in your app's own layout. They're built with Nuxt UI's UAuthForm and @nuxtjs/better-auth's sign-in composables.

PagePathWhat it does
Sign in/loginEmail and password, and every other way to sign in you've turned on
Sign up/signupName, email and password; "Check your email" when you require verification
Forgot password/forgot-passwordEmails a reset link. The answer is the same whether or not the email has an account
Reset password/reset-passwordWhere reset links land: choose a new password, or ask for a new link if it expired
Two-factor/two-factorThe second step of signing in, for users with two-factor on
Account/accountPeople's own account page
Finish account/finish-accountFor providers that share no email

Only what your set-up supports

Each page reads your Better Auth set-up at runtime and shows only what it supports:

  • a button for each sign-in provider you've configured;
  • sign-up only when it's enabled;
  • your password length rules;
  • "Forgot password?" only when reset emails are set up.

Under the email and password form, the other ways to sign in are grouped: your providers as a row of icons, then passkeys, sign-in links, codes and single sign-on, then "Continue as a guest".

Moving or turning off a page

If your app already has a page at one of these paths, your page wins: the module skips its own. To move a page, or turn it off, use pages:

nuxt.config.ts
export default defineNuxtConfig({
  betterAuthUi: {
    pages: {
      signIn: '/sign-in',
      signUp: false
    }
  }
})
signIn
string | falsedefault: '/login'
@nuxtjs/better-auth sends signed-out visitors here by default.
signUp
string | falsedefault: '/signup'
forgotPassword
string | falsedefault: '/forgot-password'
resetPassword
string | falsedefault: '/reset-password'
Where password reset links land.
account
string | falsedefault: '/account'
twoFactor
string | falsedefault: '/two-factor'
finishAccount
string | falsedefault: '/finish-account'

Where people go

  • After signing in, people go back where they came from (the ?redirect= that @nuxtjs/better-auth adds, checked to be a path on your site), else to its redirects.authenticated, else /.
  • Signed-in visitors are sent away from the sign-in pages.
  • New accounts from a provider start on the account page (Better Auth's newUserCallbackURL).
  • A failed provider sign-in (for example, GitHub hiding the email) comes back to the sign-in page with a readable message (Better Auth's errorCallbackURL).
  • Signing out, from the account page or the admin menu, goes to /. Change it with signOutRedirect:
nuxt.config.ts
export default defineNuxtConfig({
  betterAuthUi: {
    signOutRedirect: '/goodbye'
  }
})

Last used method

With lastLoginMethod: true, the sign-in page says "Last time, you signed in with GitHub" and highlights that button. It's Better Auth's Last Login Method plugin, which remembers the method in a cookie for 30 days. The page reads the cookie on the server, so nothing flashes.

nuxt.config.ts
export default defineNuxtConfig({
  betterAuthUi: {
    lastLoginMethod: true
  }
})
The cookie is non-essential under GDPR: mention it where you list your cookies.