# 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: `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`.

## 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klai.studio/reference/authentication/basic-auth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
