auth-vir 1.3.0 → 1.3.1

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.
@@ -4,7 +4,7 @@ import { type CreateJwtParams, type ParseJwtParams } from './jwt.js';
4
4
  *
5
5
  * @category Internal
6
6
  */
7
- export declare const userJwtDataShape: import("object-shape-tester").ShapeDefinition<{
7
+ export declare const userJwtDataShape: import("object-shape-tester").Shape<{
8
8
  /** The id from your database of the user you're authenticating. */
9
9
  userId: string;
10
10
  /**
@@ -13,7 +13,7 @@ export declare const userJwtDataShape: import("object-shape-tester").ShapeDefini
13
13
  * Consider using {@link generateCsrfToken} to generate this.
14
14
  */
15
15
  csrfToken: string;
16
- }, false>;
16
+ }>;
17
17
  /**
18
18
  * Data required for user JWTs.
19
19
  *
package/dist/user-jwt.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineShape, isValidShape } from 'object-shape-tester';
1
+ import { checkValidShape, defineShape } from 'object-shape-tester';
2
2
  import { createJwt, parseJwt } from './jwt.js';
3
3
  /**
4
4
  * Shape definition and source of truth for {@link UserJwtData}.
@@ -34,7 +34,7 @@ export async function createUserJwt(data, params) {
34
34
  */
35
35
  export async function parseUserJwt(encryptedJwt, params) {
36
36
  const parsed = await parseJwt(encryptedJwt, params);
37
- if (!isValidShape(parsed, userJwtDataShape)) {
37
+ if (!checkValidShape(parsed, userJwtDataShape)) {
38
38
  throw new TypeError('Verified jwt has wrong data.');
39
39
  }
40
40
  return parsed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth-vir",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Auth made easy and secure via JWT cookies, CSRF tokens, and password hashing helpers.",
5
5
  "keywords": [
6
6
  "auth",
@@ -40,17 +40,17 @@
40
40
  "test:update": "npm test update"
41
41
  },
42
42
  "dependencies": {
43
- "@augment-vir/assert": "^31.32.2",
44
- "@augment-vir/common": "^31.32.2",
45
- "date-vir": "^7.4.0",
43
+ "@augment-vir/assert": "^31.33.0",
44
+ "@augment-vir/common": "^31.33.0",
45
+ "date-vir": "^7.4.2",
46
46
  "hash-wasm": "^4.12.0",
47
- "jose": "^6.0.12",
48
- "object-shape-tester": "^5.3.0",
47
+ "jose": "^6.1.0",
48
+ "object-shape-tester": "^6.2.0",
49
49
  "type-fest": "^4.41.0",
50
- "url-vir": "^2.1.3"
50
+ "url-vir": "^2.1.5"
51
51
  },
52
52
  "devDependencies": {
53
- "@augment-vir/test": "^31.32.2",
53
+ "@augment-vir/test": "^31.33.0",
54
54
  "@web/dev-server-esbuild": "^1.0.4",
55
55
  "@web/test-runner": "^0.20.2",
56
56
  "@web/test-runner-commands": "^0.9.0",
@@ -58,7 +58,7 @@
58
58
  "@web/test-runner-visual-regression": "^0.10.0",
59
59
  "istanbul-smart-text-reporter": "^1.1.5",
60
60
  "markdown-code-example-inserter": "^3.0.3",
61
- "typedoc": "^0.28.10"
61
+ "typedoc": "^0.28.12"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22"
package/src/user-jwt.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {defineShape, isValidShape} from 'object-shape-tester';
1
+ import {checkValidShape, defineShape} from 'object-shape-tester';
2
2
  import {type generateCsrfToken} from './csrf-token.js';
3
3
  import {createJwt, type CreateJwtParams, parseJwt, type ParseJwtParams} from './jwt.js';
4
4
 
@@ -52,7 +52,7 @@ export async function parseUserJwt(
52
52
  ): Promise<UserJwtData | undefined> {
53
53
  const parsed = await parseJwt(encryptedJwt, params);
54
54
 
55
- if (!isValidShape(parsed, userJwtDataShape)) {
55
+ if (!checkValidShape(parsed, userJwtDataShape)) {
56
56
  throw new TypeError('Verified jwt has wrong data.');
57
57
  }
58
58