@solvapay/auth 1.0.0-preview.9 → 1.0.1-preview.2
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.
- package/LICENSE.md +21 -0
- package/README.md +149 -33
- package/dist/adapter-Lx7F0MH7.d.cts +64 -0
- package/dist/adapter-Lx7F0MH7.d.ts +64 -0
- package/dist/{chunk-B4VVTQWS.js → chunk-IOLE5BMD.js} +6 -8
- package/dist/index.cjs +129 -8
- package/dist/index.d.cts +68 -1
- package/dist/index.d.ts +68 -1
- package/dist/index.js +122 -1
- package/dist/mock.d.cts +1 -1
- package/dist/mock.d.ts +1 -1
- package/dist/next-utils.cjs +6 -8
- package/dist/next-utils.d.cts +91 -16
- package/dist/next-utils.d.ts +91 -16
- package/dist/next-utils.js +1 -1
- package/dist/supabase.d.cts +1 -1
- package/dist/supabase.d.ts +1 -1
- package/package.json +6 -5
- package/dist/adapter-4HTpALyc.d.cts +0 -32
- package/dist/adapter-4HTpALyc.d.ts +0 -32
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth Adapter Interface
|
|
3
|
-
*
|
|
4
|
-
* Defines the contract for authentication adapters that extract user IDs from requests.
|
|
5
|
-
* Implementations should never throw - return null if authentication fails or is missing.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Request-like object that has headers
|
|
9
|
-
*/
|
|
10
|
-
interface RequestLike {
|
|
11
|
-
headers: Headers | {
|
|
12
|
-
get(name: string): string | null;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Auth adapter interface for extracting user IDs from requests
|
|
17
|
-
*/
|
|
18
|
-
interface AuthAdapter {
|
|
19
|
-
/**
|
|
20
|
-
* Extract the authenticated user ID from a request
|
|
21
|
-
*
|
|
22
|
-
* @param req - Request object or object with headers
|
|
23
|
-
* @returns The user ID string if authenticated, null otherwise
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* This method should never throw. If authentication fails or is missing,
|
|
27
|
-
* return null and let the caller decide how to handle unauthenticated requests.
|
|
28
|
-
*/
|
|
29
|
-
getUserIdFromRequest(req: Request | RequestLike): Promise<string | null>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type { AuthAdapter as A, RequestLike as R };
|