@versini/auth-provider 8.0.2 → 8.0.3
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/dist/auth.js +4 -4
- package/dist/auth0.js +3 -3
- package/dist/hooks.js +3 -3
- package/dist/{index-CJYVbSzH.js → index-DxGUVOpC.js} +79 -79
- package/dist/index.js +4 -4
- package/package.json +3 -3
package/dist/auth.js
CHANGED
|
@@ -2,17 +2,17 @@ var Pe = Object.defineProperty;
|
|
|
2
2
|
var Ce = (e, t, n) => t in e ? Pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var K = (e, t, n) => Ce(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as H } from "react/jsx-runtime";
|
|
5
|
-
import { at as ie, st as ve,
|
|
5
|
+
import { at as ie, st as ve, K as T, ot as M, nt as C, Ye as D, ct as Ue } from "./index-DxGUVOpC.js";
|
|
6
6
|
import De, { useSyncExternalStore as Le, useCallback as S, useEffect as ce, createContext as $e, useContext as Ke, useReducer as Ye, useRef as Ge } from "react";
|
|
7
7
|
import { AuthHookContext as Ve } from "./AuthHookContext-C9a2AwWZ.js";
|
|
8
8
|
/*!
|
|
9
|
-
@versini/auth-provider v8.0.
|
|
9
|
+
@versini/auth-provider v8.0.3
|
|
10
10
|
© 2025 gizmette.com
|
|
11
11
|
*/
|
|
12
12
|
try {
|
|
13
13
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
14
|
-
version: "8.0.
|
|
15
|
-
buildTime: "
|
|
14
|
+
version: "8.0.3",
|
|
15
|
+
buildTime: "06/02/2025 05:45 PM EDT",
|
|
16
16
|
homepage: "https://github.com/aversini/auth-client",
|
|
17
17
|
license: "MIT"
|
|
18
18
|
});
|
package/dist/auth0.js
CHANGED
|
@@ -2,13 +2,13 @@ import { jsx as B } from "react/jsx-runtime";
|
|
|
2
2
|
import Oe, { createContext as Te, useState as Pe, useReducer as Ce, useRef as Ee, useCallback as R, useEffect as je, useMemo as ze, useContext as xe } from "react";
|
|
3
3
|
import { AuthHookContext as Re } from "./AuthHookContext-C9a2AwWZ.js";
|
|
4
4
|
/*!
|
|
5
|
-
@versini/auth-provider v8.0.
|
|
5
|
+
@versini/auth-provider v8.0.3
|
|
6
6
|
© 2025 gizmette.com
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
9
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
10
|
-
version: "8.0.
|
|
11
|
-
buildTime: "
|
|
10
|
+
version: "8.0.3",
|
|
11
|
+
buildTime: "06/02/2025 05:45 PM EDT",
|
|
12
12
|
homepage: "https://github.com/aversini/auth-client",
|
|
13
13
|
license: "MIT"
|
|
14
14
|
});
|
package/dist/hooks.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useContext as o } from "react";
|
|
2
2
|
import { AuthHookContext as e } from "./AuthHookContext-C9a2AwWZ.js";
|
|
3
3
|
/*!
|
|
4
|
-
@versini/auth-provider v8.0.
|
|
4
|
+
@versini/auth-provider v8.0.3
|
|
5
5
|
© 2025 gizmette.com
|
|
6
6
|
*/
|
|
7
7
|
try {
|
|
8
8
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
9
|
-
version: "8.0.
|
|
10
|
-
buildTime: "
|
|
9
|
+
version: "8.0.3",
|
|
10
|
+
buildTime: "06/02/2025 05:45 PM EDT",
|
|
11
11
|
homepage: "https://github.com/aversini/auth-client",
|
|
12
12
|
license: "MIT"
|
|
13
13
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var ee = Object.defineProperty, te = (e, t, r) => t in e ? ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, c = (e, t, r) => te(e, typeof t != "symbol" ? t + "" : t, r);
|
|
2
2
|
/*!
|
|
3
|
-
@versini/auth-common v4.
|
|
3
|
+
@versini/auth-common v4.4.0
|
|
4
4
|
© 2025 gizmette.com
|
|
5
5
|
*/
|
|
6
6
|
try {
|
|
7
7
|
window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
|
|
8
|
-
version: "4.
|
|
9
|
-
buildTime: "
|
|
8
|
+
version: "4.4.0",
|
|
9
|
+
buildTime: "06/02/2025 05:45 PM EDT",
|
|
10
10
|
homepage: "https://github.com/aversini/auth-client",
|
|
11
11
|
license: "MIT"
|
|
12
12
|
});
|
|
@@ -49,7 +49,7 @@ awIDAQAB
|
|
|
49
49
|
LOGOUT: "logout",
|
|
50
50
|
LOGIN: "login",
|
|
51
51
|
REFRESH: "refresh"
|
|
52
|
-
},
|
|
52
|
+
}, _ = new TextEncoder(), C = new TextDecoder();
|
|
53
53
|
function ae(...e) {
|
|
54
54
|
const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
|
|
55
55
|
let a = 0;
|
|
@@ -85,12 +85,12 @@ class A extends Error {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
c(A, "code", "ERR_JOSE_GENERIC");
|
|
88
|
-
class
|
|
88
|
+
class p extends A {
|
|
89
89
|
constructor(t, r, a = "unspecified", n = "unspecified") {
|
|
90
90
|
super(t, { cause: { claim: a, reason: n, payload: r } }), c(this, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED"), c(this, "claim"), c(this, "reason"), c(this, "payload"), this.claim = a, this.reason = n, this.payload = r;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
c(
|
|
93
|
+
c(p, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
|
|
94
94
|
class D extends A {
|
|
95
95
|
constructor(t, r, a = "unspecified", n = "unspecified") {
|
|
96
96
|
super(t, { cause: { claim: a, reason: n, payload: r } }), c(this, "code", "ERR_JWT_EXPIRED"), c(this, "claim"), c(this, "reason"), c(this, "payload"), this.claim = a, this.reason = n, this.payload = r;
|
|
@@ -109,12 +109,12 @@ class E extends A {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
c(E, "code", "ERR_JOSE_NOT_SUPPORTED");
|
|
112
|
-
class
|
|
112
|
+
class l extends A {
|
|
113
113
|
constructor() {
|
|
114
114
|
super(...arguments), c(this, "code", "ERR_JWS_INVALID");
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
c(
|
|
117
|
+
c(l, "code", "ERR_JWS_INVALID");
|
|
118
118
|
class f extends A {
|
|
119
119
|
constructor() {
|
|
120
120
|
super(...arguments), c(this, "code", "ERR_JWT_INVALID");
|
|
@@ -223,7 +223,7 @@ function q(e) {
|
|
|
223
223
|
function z(e) {
|
|
224
224
|
return e?.[Symbol.toStringTag] === "KeyObject";
|
|
225
225
|
}
|
|
226
|
-
const Q = (e) => q(e) || z(e),
|
|
226
|
+
const Q = (e) => q(e) || z(e), le = (...e) => {
|
|
227
227
|
const t = e.filter(Boolean);
|
|
228
228
|
if (t.length === 0 || t.length === 1)
|
|
229
229
|
return !0;
|
|
@@ -242,11 +242,11 @@ const Q = (e) => q(e) || z(e), de = (...e) => {
|
|
|
242
242
|
}
|
|
243
243
|
return !0;
|
|
244
244
|
};
|
|
245
|
-
function
|
|
245
|
+
function de(e) {
|
|
246
246
|
return typeof e == "object" && e !== null;
|
|
247
247
|
}
|
|
248
248
|
const T = (e) => {
|
|
249
|
-
if (!
|
|
249
|
+
if (!de(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
250
250
|
return !1;
|
|
251
251
|
if (Object.getPrototypeOf(e) === null)
|
|
252
252
|
return !0;
|
|
@@ -260,27 +260,27 @@ const T = (e) => {
|
|
|
260
260
|
if (typeof r != "number" || r < 2048)
|
|
261
261
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
|
262
262
|
}
|
|
263
|
-
},
|
|
263
|
+
}, K = (e, t, r = 0) => {
|
|
264
264
|
r === 0 && (t.unshift(t.length), t.unshift(6));
|
|
265
265
|
const a = e.indexOf(t[0], r);
|
|
266
266
|
if (a === -1)
|
|
267
267
|
return !1;
|
|
268
268
|
const n = e.subarray(a, a + t.length);
|
|
269
|
-
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) ||
|
|
269
|
+
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || K(e, t, a + 1);
|
|
270
270
|
}, ye = (e) => {
|
|
271
271
|
switch (!0) {
|
|
272
|
-
case
|
|
272
|
+
case K(e, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
273
273
|
return "P-256";
|
|
274
|
-
case
|
|
274
|
+
case K(e, [43, 129, 4, 0, 34]):
|
|
275
275
|
return "P-384";
|
|
276
|
-
case
|
|
276
|
+
case K(e, [43, 129, 4, 0, 35]):
|
|
277
277
|
return "P-521";
|
|
278
278
|
default:
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
|
-
},
|
|
281
|
+
}, pe = async (e, t, r, a, n) => {
|
|
282
282
|
let o, s;
|
|
283
|
-
const i = new Uint8Array(atob(r.replace(e, "")).split("").map((
|
|
283
|
+
const i = new Uint8Array(atob(r.replace(e, "")).split("").map((d) => d.charCodeAt(0)));
|
|
284
284
|
switch (a) {
|
|
285
285
|
case "PS256":
|
|
286
286
|
case "PS384":
|
|
@@ -314,8 +314,8 @@ const T = (e) => {
|
|
|
314
314
|
case "ECDH-ES+A128KW":
|
|
315
315
|
case "ECDH-ES+A192KW":
|
|
316
316
|
case "ECDH-ES+A256KW": {
|
|
317
|
-
const
|
|
318
|
-
o =
|
|
317
|
+
const d = ye(i);
|
|
318
|
+
o = d != null && d.startsWith("P-") ? { name: "ECDH", namedCurve: d } : { name: "X25519" }, s = [];
|
|
319
319
|
break;
|
|
320
320
|
}
|
|
321
321
|
case "Ed25519":
|
|
@@ -326,7 +326,7 @@ const T = (e) => {
|
|
|
326
326
|
throw new E('Invalid or unsupported "alg" (Algorithm) value');
|
|
327
327
|
}
|
|
328
328
|
return crypto.subtle.importKey(t, i, o, !0, s);
|
|
329
|
-
},
|
|
329
|
+
}, he = (e, t, r) => pe(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
|
330
330
|
function fe(e) {
|
|
331
331
|
let t, r;
|
|
332
332
|
switch (e.kty) {
|
|
@@ -409,7 +409,7 @@ const me = async (e) => {
|
|
|
409
409
|
async function we(e, t, r) {
|
|
410
410
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
411
411
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
412
|
-
return
|
|
412
|
+
return he(e, t);
|
|
413
413
|
}
|
|
414
414
|
const Se = (e, t, r, a, n) => {
|
|
415
415
|
if (n.crit !== void 0 && a?.crit === void 0)
|
|
@@ -650,7 +650,7 @@ const $ = async (e, t, r, a = !1) => {
|
|
|
650
650
|
}
|
|
651
651
|
}, Te = (e, t, r) => {
|
|
652
652
|
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e) || /^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e) ? ke(e, t, r) : Pe(e, t, r);
|
|
653
|
-
},
|
|
653
|
+
}, Re = (e, t) => {
|
|
654
654
|
const r = `SHA-${e.slice(-3)}`;
|
|
655
655
|
switch (e) {
|
|
656
656
|
case "HS256":
|
|
@@ -675,17 +675,17 @@ const $ = async (e, t, r, a = !1) => {
|
|
|
675
675
|
default:
|
|
676
676
|
throw new E(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
677
677
|
}
|
|
678
|
-
},
|
|
678
|
+
}, _e = async (e, t, r) => {
|
|
679
679
|
if (t instanceof Uint8Array) {
|
|
680
680
|
if (!e.startsWith("HS"))
|
|
681
681
|
throw new TypeError(ce(t, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
682
682
|
return crypto.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
|
|
683
683
|
}
|
|
684
684
|
return ie(t, e, r), t;
|
|
685
|
-
},
|
|
686
|
-
const n = await
|
|
685
|
+
}, Ke = async (e, t, r, a) => {
|
|
686
|
+
const n = await _e(e, t, "verify");
|
|
687
687
|
ue(e, n);
|
|
688
|
-
const o =
|
|
688
|
+
const o = Re(e, n.algorithm);
|
|
689
689
|
try {
|
|
690
690
|
return await crypto.subtle.verify(o, n, r, a);
|
|
691
691
|
} catch {
|
|
@@ -694,76 +694,76 @@ const $ = async (e, t, r, a = !1) => {
|
|
|
694
694
|
};
|
|
695
695
|
async function Ie(e, t, r) {
|
|
696
696
|
if (!T(e))
|
|
697
|
-
throw new
|
|
697
|
+
throw new l("Flattened JWS must be an object");
|
|
698
698
|
if (e.protected === void 0 && e.header === void 0)
|
|
699
|
-
throw new
|
|
699
|
+
throw new l('Flattened JWS must have either of the "protected" or "header" members');
|
|
700
700
|
if (e.protected !== void 0 && typeof e.protected != "string")
|
|
701
|
-
throw new
|
|
701
|
+
throw new l("JWS Protected Header incorrect type");
|
|
702
702
|
if (e.payload === void 0)
|
|
703
|
-
throw new
|
|
703
|
+
throw new l("JWS Payload missing");
|
|
704
704
|
if (typeof e.signature != "string")
|
|
705
|
-
throw new
|
|
705
|
+
throw new l("JWS Signature missing or incorrect type");
|
|
706
706
|
if (e.header !== void 0 && !T(e.header))
|
|
707
|
-
throw new
|
|
707
|
+
throw new l("JWS Unprotected Header incorrect type");
|
|
708
708
|
let a = {};
|
|
709
709
|
if (e.protected)
|
|
710
710
|
try {
|
|
711
711
|
const O = P(e.protected);
|
|
712
712
|
a = JSON.parse(C.decode(O));
|
|
713
713
|
} catch {
|
|
714
|
-
throw new
|
|
714
|
+
throw new l("JWS Protected Header is invalid");
|
|
715
715
|
}
|
|
716
|
-
if (!
|
|
717
|
-
throw new
|
|
716
|
+
if (!le(a, e.header))
|
|
717
|
+
throw new l("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
718
718
|
const n = {
|
|
719
719
|
...a,
|
|
720
720
|
...e.header
|
|
721
|
-
}, o = Se(
|
|
721
|
+
}, o = Se(l, /* @__PURE__ */ new Map([["b64", !0]]), r?.crit, a, n);
|
|
722
722
|
let s = !0;
|
|
723
723
|
if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
|
|
724
|
-
throw new
|
|
724
|
+
throw new l('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
725
725
|
const { alg: i } = n;
|
|
726
726
|
if (typeof i != "string" || !i)
|
|
727
|
-
throw new
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
727
|
+
throw new l('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
728
|
+
const d = r && Ee("algorithms", r.algorithms);
|
|
729
|
+
if (d && !d.has(i))
|
|
730
730
|
throw new Y('"alg" (Algorithm) Header Parameter value not allowed');
|
|
731
731
|
if (s) {
|
|
732
732
|
if (typeof e.payload != "string")
|
|
733
|
-
throw new
|
|
733
|
+
throw new l("JWS Payload must be a string");
|
|
734
734
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
735
|
-
throw new
|
|
735
|
+
throw new l("JWS Payload must be a string or an Uint8Array instance");
|
|
736
736
|
let m = !1;
|
|
737
737
|
typeof t == "function" && (t = await t(a, e), m = !0), Te(i, t, "verify");
|
|
738
|
-
const b = ae(
|
|
739
|
-
let
|
|
738
|
+
const b = ae(_.encode(e.protected ?? ""), _.encode("."), typeof e.payload == "string" ? _.encode(e.payload) : e.payload);
|
|
739
|
+
let h;
|
|
740
740
|
try {
|
|
741
|
-
|
|
741
|
+
h = P(e.signature);
|
|
742
742
|
} catch {
|
|
743
|
-
throw new
|
|
743
|
+
throw new l("Failed to base64url decode the signature");
|
|
744
744
|
}
|
|
745
|
-
const
|
|
746
|
-
if (!await
|
|
745
|
+
const R = await Ce(t, i);
|
|
746
|
+
if (!await Ke(i, R, h, b))
|
|
747
747
|
throw new F();
|
|
748
748
|
let S;
|
|
749
749
|
if (s)
|
|
750
750
|
try {
|
|
751
751
|
S = P(e.payload);
|
|
752
752
|
} catch {
|
|
753
|
-
throw new
|
|
753
|
+
throw new l("Failed to base64url decode the payload");
|
|
754
754
|
}
|
|
755
|
-
else typeof e.payload == "string" ? S =
|
|
755
|
+
else typeof e.payload == "string" ? S = _.encode(e.payload) : S = e.payload;
|
|
756
756
|
const y = { payload: S };
|
|
757
|
-
return e.protected !== void 0 && (y.protectedHeader = a), e.header !== void 0 && (y.unprotectedHeader = e.header), m ? { ...y, key:
|
|
757
|
+
return e.protected !== void 0 && (y.protectedHeader = a), e.header !== void 0 && (y.unprotectedHeader = e.header), m ? { ...y, key: R } : y;
|
|
758
758
|
}
|
|
759
759
|
async function Oe(e, t, r) {
|
|
760
760
|
if (e instanceof Uint8Array && (e = C.decode(e)), typeof e != "string")
|
|
761
|
-
throw new
|
|
761
|
+
throw new l("Compact JWS must be a string or Uint8Array");
|
|
762
762
|
const { 0: a, 1: n, 2: o, length: s } = e.split(".");
|
|
763
763
|
if (s !== 3)
|
|
764
|
-
throw new
|
|
765
|
-
const i = await Ie({ payload: n, protected: a, signature: o }, t, r),
|
|
766
|
-
return typeof t == "function" ? { ...
|
|
764
|
+
throw new l("Invalid Compact JWS");
|
|
765
|
+
const i = await Ie({ payload: n, protected: a, signature: o }, t, r), d = { payload: i.payload, protectedHeader: i.protectedHeader };
|
|
766
|
+
return typeof t == "function" ? { ...d, key: i.key } : d;
|
|
767
767
|
}
|
|
768
768
|
const He = (e) => Math.floor(e.getTime() / 1e3), X = 60, Z = X * 60, N = Z * 24, We = N * 7, De = N * 365.25, Je = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, j = (e) => {
|
|
769
769
|
const t = Je.exec(e);
|
|
@@ -819,53 +819,53 @@ function Ne(e, t, r = {}) {
|
|
|
819
819
|
throw new f("JWT Claims Set must be a top-level JSON object");
|
|
820
820
|
const { typ: n } = r;
|
|
821
821
|
if (n && (typeof e.typ != "string" || L(e.typ) !== L(n)))
|
|
822
|
-
throw new
|
|
823
|
-
const { requiredClaims: o = [], issuer: s, subject: i, audience:
|
|
824
|
-
m !== void 0 && b.push("iat"),
|
|
822
|
+
throw new p('unexpected "typ" JWT header value', a, "typ", "check_failed");
|
|
823
|
+
const { requiredClaims: o = [], issuer: s, subject: i, audience: d, maxTokenAge: m } = r, b = [...o];
|
|
824
|
+
m !== void 0 && b.push("iat"), d !== void 0 && b.push("aud"), i !== void 0 && b.push("sub"), s !== void 0 && b.push("iss");
|
|
825
825
|
for (const y of new Set(b.reverse()))
|
|
826
826
|
if (!(y in a))
|
|
827
|
-
throw new
|
|
827
|
+
throw new p(`missing required "${y}" claim`, a, y, "missing");
|
|
828
828
|
if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
|
|
829
|
-
throw new
|
|
829
|
+
throw new p('unexpected "iss" claim value', a, "iss", "check_failed");
|
|
830
830
|
if (i && a.sub !== i)
|
|
831
|
-
throw new
|
|
832
|
-
if (
|
|
833
|
-
throw new
|
|
834
|
-
let
|
|
831
|
+
throw new p('unexpected "sub" claim value', a, "sub", "check_failed");
|
|
832
|
+
if (d && !Ue(a.aud, typeof d == "string" ? [d] : d))
|
|
833
|
+
throw new p('unexpected "aud" claim value', a, "aud", "check_failed");
|
|
834
|
+
let h;
|
|
835
835
|
switch (typeof r.clockTolerance) {
|
|
836
836
|
case "string":
|
|
837
|
-
|
|
837
|
+
h = j(r.clockTolerance);
|
|
838
838
|
break;
|
|
839
839
|
case "number":
|
|
840
|
-
|
|
840
|
+
h = r.clockTolerance;
|
|
841
841
|
break;
|
|
842
842
|
case "undefined":
|
|
843
|
-
|
|
843
|
+
h = 0;
|
|
844
844
|
break;
|
|
845
845
|
default:
|
|
846
846
|
throw new TypeError("Invalid clockTolerance option type");
|
|
847
847
|
}
|
|
848
|
-
const { currentDate:
|
|
848
|
+
const { currentDate: R } = r, S = He(R || /* @__PURE__ */ new Date());
|
|
849
849
|
if ((a.iat !== void 0 || m) && typeof a.iat != "number")
|
|
850
|
-
throw new
|
|
850
|
+
throw new p('"iat" claim must be a number', a, "iat", "invalid");
|
|
851
851
|
if (a.nbf !== void 0) {
|
|
852
852
|
if (typeof a.nbf != "number")
|
|
853
|
-
throw new
|
|
854
|
-
if (a.nbf > S +
|
|
855
|
-
throw new
|
|
853
|
+
throw new p('"nbf" claim must be a number', a, "nbf", "invalid");
|
|
854
|
+
if (a.nbf > S + h)
|
|
855
|
+
throw new p('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
|
|
856
856
|
}
|
|
857
857
|
if (a.exp !== void 0) {
|
|
858
858
|
if (typeof a.exp != "number")
|
|
859
|
-
throw new
|
|
860
|
-
if (a.exp <= S -
|
|
859
|
+
throw new p('"exp" claim must be a number', a, "exp", "invalid");
|
|
860
|
+
if (a.exp <= S - h)
|
|
861
861
|
throw new D('"exp" claim timestamp check failed', a, "exp", "check_failed");
|
|
862
862
|
}
|
|
863
863
|
if (m) {
|
|
864
864
|
const y = S - a.iat, O = typeof m == "number" ? m : j(m);
|
|
865
|
-
if (y -
|
|
865
|
+
if (y - h > O)
|
|
866
866
|
throw new D('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
|
|
867
|
-
if (y < 0 -
|
|
868
|
-
throw new
|
|
867
|
+
if (y < 0 - h)
|
|
868
|
+
throw new p('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
|
|
869
869
|
}
|
|
870
870
|
return a;
|
|
871
871
|
}
|
|
@@ -974,7 +974,7 @@ const et = async (e, t) => {
|
|
|
974
974
|
);
|
|
975
975
|
};
|
|
976
976
|
export {
|
|
977
|
-
I as
|
|
977
|
+
I as K,
|
|
978
978
|
Le as Ye,
|
|
979
979
|
ze as at,
|
|
980
980
|
Ze as ct,
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { nt as t, ft as r } from "./index-
|
|
1
|
+
import { nt as t, ft as r } from "./index-DxGUVOpC.js";
|
|
2
2
|
/*!
|
|
3
|
-
@versini/auth-provider v8.0.
|
|
3
|
+
@versini/auth-provider v8.0.3
|
|
4
4
|
© 2025 gizmette.com
|
|
5
5
|
*/
|
|
6
6
|
try {
|
|
7
7
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
8
|
-
version: "8.0.
|
|
9
|
-
buildTime: "
|
|
8
|
+
version: "8.0.3",
|
|
9
|
+
buildTime: "06/02/2025 05:45 PM EDT",
|
|
10
10
|
homepage: "https://github.com/aversini/auth-client",
|
|
11
11
|
license: "MIT"
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/auth-provider",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@auth0/auth0-react": "2.3.0",
|
|
57
57
|
"@simplewebauthn/browser": "13.1.0",
|
|
58
|
-
"@versini/auth-common": "4.
|
|
58
|
+
"@versini/auth-common": "4.4.0",
|
|
59
59
|
"@versini/ui-hooks": "4.7.3",
|
|
60
60
|
"jose": "6.0.10",
|
|
61
61
|
"uuid": "11.1.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "3109c57783f179b3d0f2fee8cecf16cc8ba333e1"
|
|
64
64
|
}
|