> For the complete documentation index, see [llms.txt](https://docs.klai.studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.klai.studio/reference/authentication/basic-auth.md).

# Basic Authentication

Basic Authentication uses the internal `Users` table with email and hashed password. It supports registration, email verification, login, logout, password resets, invite completion, and magic-link sign-in.

## Scope

* Internal Users table and fields (e.g., email, passwordHash, isVerified, isEnabled)
* Page-level actions for auth screens
* Server-side hooks for workflows and notifications

## Core Workflows

* Registration ➜ verification email sent ➜ user verified
* Login ➜ access to restricted pages
* Forgot/Reset password ➜ time-bound token ➜ set new password
* Developer invite completion ➜ developer-issued token ➜ set new password (`authInviteComplete`)
* Magic link ➜ request sign-in link ➜ click link ➜ token-based login
* Logout ➜ session cleanup

## Building Blocks

* Actions: `authRegister`, `authVerify`, `authLogin`, `authLogout`, `authForgot`, `authMagicRequest`, `authReset`, `authInviteComplete`, `authResend`
* Hooks: `onBeforeRegistration`, `onRegistration`, `onLogin`, `onAuthNotifier`
* Data: Users table stores email and password hash; verification/reset tokens are treated as secrets

## Version Note

* Magic-link support was added in BetterForms `3.4.x`.
* Password signup also calls `onBeforeRegistration` starting in `3.5.x` (OAuth already used this hook). See [Controlling Who Can Sign Up](/reference/authentication/basic-auth/user-registration.md#controlling-who-can-sign-up).

## Next

* See [User Registration & Verification](/reference/authentication/basic-auth/user-registration.md) for step-by-step guidance
* See [Password Management](/reference/authentication/basic-auth/password-management.md) for forgot/reset and admin reset patterns
