@molecule/api-jwt 1.0.8 → 1.0.10
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 +6 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-
|
|
6
|
+
Generated: 2026-11-04T14:19:58.727Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-jwt
|
|
@@ -258,14 +258,15 @@ and verify changes with it.
|
|
|
258
258
|
To return a session token in a response BODY — an API whose clients send
|
|
259
259
|
`Authorization: Token <jwt>` — do not sign a second token with another key or
|
|
260
260
|
algorithm. `authorization.set(req, res, { userId, deviceId })` from
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
`@molecule/api-resource-user` RETURNS the signed token; mount
|
|
262
|
+
`verifyMiddleware({ allowCookieSession: false })` in front of the routes that
|
|
263
|
+
sign users in so no session cookie is written alongside it.
|
|
263
264
|
|
|
264
265
|
```typescript
|
|
265
266
|
function sign(
|
|
266
267
|
object: JSONObject,
|
|
267
268
|
{ algorithm = JWT_ALGORITHM, expiresIn = JWT_EXPIRES_TIME, ...rest }?: JwtSignOptions,
|
|
268
|
-
privateKey?: string | Buffer
|
|
269
|
+
privateKey?: string | Buffer,
|
|
269
270
|
): string
|
|
270
271
|
```
|
|
271
272
|
|
|
@@ -286,7 +287,7 @@ algorithm and public key as defaults.
|
|
|
286
287
|
function verify(
|
|
287
288
|
token: string,
|
|
288
289
|
{ algorithms = [JWT_ALGORITHM], ...rest }?: JwtVerifyOptions,
|
|
289
|
-
publicKey?: string | Buffer
|
|
290
|
+
publicKey?: string | Buffer,
|
|
290
291
|
): string | JwtPayload
|
|
291
292
|
```
|
|
292
293
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-jwt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "JWT interface and key management for molecule.dev",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@molecule/api-bond": "^1.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@molecule/api-bond": "1.0.
|
|
34
|
+
"@molecule/api-bond": "1.0.4",
|
|
35
35
|
"@types/node": "26.6.5",
|
|
36
36
|
"typescript": "6.0.3",
|
|
37
37
|
"vitest": "4.1.12"
|