-
Notifications
You must be signed in to change notification settings - Fork 1
auth Overview
The central authentication and identity abstraction for the Quatrain ecosystem. It provides a standard way to manage users, roles, and sessions across various Identity Providers (IdP).
Authentication often ties an application tightly to a specific vendor. By using @quatrain/auth, your application code interacts with a generic API for checking logins, retrieving user metadata, and enforcing permissions, while the actual implementation is delegated to adapters (Firebase Auth, Supabase Auth, etc.).
-
Auth: The static registry where authentication adapters are configured. -
AbstractAuthAdapter: The base class for handling token verification, user fetching, and session management.
npm install @quatrain/auth
# You will also need an adapter, e.g.:
npm install @quatrain/auth-firebaseAt startup, register an adapter with Auth.addAdapter(). In your middleware or API routes, use Auth.getAdapter().verifyToken(token) to validate incoming requests and extract the normalized user profile.
For concrete examples and usage guides, please refer to the How-To Guide.
AGPL-3.0-only