@quatrain/auth 1.1.26 → 1.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -18
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,32 +1,28 @@
1
1
  # @quatrain/auth
2
2
 
3
- This package provides authentication and authorization abstractions for Quatrain applications. It defines a consistent interface for managing users, sessions, and tokens across different authentication providers.
3
+ 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).
4
4
 
5
- ## Features
5
+ ## Introduction
6
6
 
7
- - **Abstract Adapter**: A common interface for authentication providers.
8
- - **User Management**: Handles user registration, login, and profile updates.
9
- - **Token Handling**: Manages JWT verification and refresh logic.
10
- - **Middleware Integration**: Provides hooks for protecting backend routes.
7
+ 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.).
8
+
9
+ ## Key Concepts
10
+
11
+ - **`Auth`**: The static registry where authentication adapters are configured.
12
+ - **`AbstractAuthAdapter`**: The base class for handling token verification, user fetching, and session management.
11
13
 
12
14
  ## Installation
13
15
 
14
16
  ```bash
15
17
  npm install @quatrain/auth
18
+ # You will also need an adapter, e.g.:
19
+ npm install @quatrain/auth-firebase
16
20
  ```
17
21
 
18
- ## Usage
22
+ ## Architecture
19
23
 
20
- This package is meant to be used with a concrete authentication adapter, such as `@quatrain/auth-firebase` or `@quatrain/auth-supabase`.
24
+ At 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.
21
25
 
22
- ```typescript
23
- import { Auth } from '@quatrain/auth'
24
- import { SupabaseAuthAdapter } from '@quatrain/auth-supabase'
26
+ ## License
25
27
 
26
- // Assuming an adapter has been added
27
- const user = await Auth.register({
28
- email: 'user@example.com',
29
- password: 'password123',
30
- })
31
- const token = await Auth.login('user@example.com', 'password123')
32
- ```
28
+ AGPL-3.0-only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/auth",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "license": "AGPL-3.0-only",
5
5
  "description": "Auth adapters commons",
6
6
  "main": "dist/index.js",
@@ -14,8 +14,8 @@
14
14
  ],
15
15
  "author": "Quatrain Développement SAS <developers@quatrain.com>",
16
16
  "dependencies": {
17
- "@quatrain/backend": "^1.1.32",
18
- "@quatrain/core": "^1.1.47"
17
+ "@quatrain/backend": "^1.1.34",
18
+ "@quatrain/core": "^1.1.48"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@tsconfig/recommended": "^1.0.1",