@spfn/auth 0.3.0-beta.15 → 0.3.0-beta.17
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/README.md +11 -1
- package/dist/index.d.ts +2 -2
- package/dist/{machine-principals-Dn-7BqYZ.d.ts → machine-principals-nrpFSvvB.d.ts} +1 -10
- package/dist/nextjs/api.js +36 -0
- package/dist/nextjs/api.js.map +1 -1
- package/dist/nextjs/client.d.ts +28 -1
- package/dist/nextjs/client.js +24 -3
- package/dist/nextjs/client.js.map +1 -1
- package/dist/nextjs/server.d.ts +2 -1
- package/dist/nextjs/server.js +22 -1
- package/dist/nextjs/server.js.map +1 -1
- package/dist/server.d.ts +3 -3
- package/dist/server.js +20 -5
- package/dist/server.js.map +1 -1
- package/dist/{session-DTHahDQ9.d.ts → session-Dfwu5g2W.d.ts} +28 -1
- package/package.json +4 -4
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { K as KeyAlgorithmType } from './types-DYyhze28.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @spfn/auth - Return-path validation
|
|
5
|
+
*
|
|
6
|
+
* One rule for every flow that hands a caller-supplied destination back to the
|
|
7
|
+
* browser: the verified-email signup link, the password reset link, and the
|
|
8
|
+
* OAuth start/callback seams. Apps that build their own destination before
|
|
9
|
+
* calling an auth route import the same function rather than writing a second
|
|
10
|
+
* rule that drifts from this one.
|
|
11
|
+
*
|
|
12
|
+
* The module imports nothing on purpose — it is part of the client bundle
|
|
13
|
+
* (`@spfn/auth/nextjs/client`), which must not pull server code in behind it.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Whether a return path can be handed back to the browser.
|
|
17
|
+
*
|
|
18
|
+
* Only a path within the app is allowed. The rejected shapes are the ones that
|
|
19
|
+
* turn a return path into an open redirect: an absolute URL, a protocol-relative
|
|
20
|
+
* `//host` that a browser reads as another origin, a backslash that some
|
|
21
|
+
* browsers normalize into a slash, any `..` traversal, and any character a URL
|
|
22
|
+
* parser strips before parsing (see above).
|
|
23
|
+
*
|
|
24
|
+
* The value is judged exactly as written: nothing is percent-decoded here. A
|
|
25
|
+
* `/a%0d%0a` is therefore a path containing those six literal characters and is
|
|
26
|
+
* accepted — no decoder downstream turns it back into header bytes.
|
|
27
|
+
*/
|
|
28
|
+
declare function isSafeReturnPath(returnPath: string): boolean;
|
|
29
|
+
|
|
3
30
|
/**
|
|
4
31
|
* @spfn/auth - Client Session Management
|
|
5
32
|
*
|
|
@@ -50,4 +77,4 @@ declare function getSessionInfo(jwt: string): Promise<{
|
|
|
50
77
|
*/
|
|
51
78
|
declare function shouldRefreshSession(jwt: string, thresholdHours?: number): Promise<boolean>;
|
|
52
79
|
|
|
53
|
-
export { type SessionData as S, shouldRefreshSession as a, getSessionInfo as g, sealSession as s, unsealSession as u };
|
|
80
|
+
export { type SessionData as S, shouldRefreshSession as a, getSessionInfo as g, isSafeReturnPath as i, sealSession as s, unsealSession as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spfn/auth",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Authentication for a Next.js full-stack app: sessions, social login, OAuth, RBAC and admin roles, without assembling an auth stack yourself",
|
|
6
6
|
"author": "Ray Im <rayim@fxy.global>",
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
"@vitest/coverage-v8": "^4.0.6",
|
|
136
136
|
"drizzle-kit": "1.0.0-rc.4",
|
|
137
137
|
"drizzle-orm": "1.0.0-rc.4",
|
|
138
|
-
"hono": "^4.
|
|
138
|
+
"hono": "^4.13.5",
|
|
139
139
|
"madge": "^8.0.0",
|
|
140
|
-
"next": "^16.
|
|
140
|
+
"next": "^16.3.3",
|
|
141
141
|
"spfn": "workspace:*",
|
|
142
142
|
"tsup": "^8.5.0",
|
|
143
143
|
"tsx": "^4.20.6",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"@spfn/core": ">=0.3.0-beta.8 <0.4.0",
|
|
149
149
|
"@spfn/notification": ">=0.2.0-beta.5 <0.3.0",
|
|
150
150
|
"drizzle-orm": ">=1.0.0-rc.4 <2",
|
|
151
|
-
"next": "^16.
|
|
151
|
+
"next": "^16.3.3"
|
|
152
152
|
},
|
|
153
153
|
"peerDependenciesMeta": {
|
|
154
154
|
"next": {
|