Docs/Guides/Authentication

Install and configure auth

Install the auth package and its declared dependencies:

1 min read

Install the auth package and its declared dependencies:

bash
bun add @veap/auth

Compose database before auth:

ts
import { Application } from "@veap/kernel";
import { DatabaseServiceProvider } from "@veap/database";
import { AuthServiceProvider } from "@veap/auth";

export const application = Application.configure()
  .use(DatabaseServiceProvider)
  .use(AuthServiceProvider)
  .create();

The inspected provider registers password hashing, token generation, secret cipher, user/session/role/permission/password-reset/email-verification repositories and services. Its route configuration merges with DEFAULT_AUTH_ROUTES. Verify the provider constructor options and database initialization order against your installed declarations.

Security configuration#

The inspected password hasher reads AUTH_BCRYPT_ROUNDS and AUTH_PASSWORD_MIN_LENGTH from ConfigService when available. Review encryption-key management, session/cookie integration and deployment secrets in source before enabling auth in production.

veap
Preparing0%