@kanzo-tech/auth 0.30.2 → 0.31.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.
- package/dist/next-auth.d.ts +1 -1
- package/dist/next-auth.d.ts.map +1 -1
- package/dist/next-auth.js.map +1 -1
- package/dist/next-bound.d.ts +22 -14
- package/dist/next-bound.d.ts.map +1 -1
- package/dist/next-bound.js +44 -38
- package/dist/next-bound.js.map +1 -1
- package/dist/next-gate.d.ts.map +1 -1
- package/dist/next-gate.js +28 -31
- package/dist/next-gate.js.map +1 -1
- package/dist/next-proxy.d.ts +12 -5
- package/dist/next-proxy.d.ts.map +1 -1
- package/dist/next-proxy.js +51 -44
- package/dist/next-proxy.js.map +1 -1
- package/dist/renew-within.d.ts +10 -0
- package/dist/renew-within.d.ts.map +1 -0
- package/dist/renew-within.js +5 -0
- package/dist/renew-within.js.map +1 -0
- package/dist/server.d.ts +44 -8
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +202 -164
- package/dist/server.js.map +1 -1
- package/dist/store.d.ts +3 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +4 -4
package/dist/server.js
CHANGED
|
@@ -1,248 +1,286 @@
|
|
|
1
|
-
import { buildEndSessionUrl as
|
|
2
|
-
import { jwtVerify as
|
|
3
|
-
import { claims as
|
|
4
|
-
import { sealedCookie as
|
|
5
|
-
import { cookieValue as
|
|
6
|
-
import { DEADLINE as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { buildEndSessionUrl as G, randomPKCECodeVerifier as M, randomState as P, randomNonce as K, calculatePKCECodeChallenge as W, buildAuthorizationUrl as F, refreshTokenGrant as H, genericGrantRequest as Z, authorizationCodeGrant as V } from "openid-client";
|
|
2
|
+
import { jwtVerify as J } from "jose";
|
|
3
|
+
import { claims as X } from "./claims.js";
|
|
4
|
+
import { sealedCookie as O } from "./cookie-session.js";
|
|
5
|
+
import { cookieValue as be } from "./cookie-session.js";
|
|
6
|
+
import { DEADLINE as Y } from "./deadline.js";
|
|
7
|
+
import { DEFAULT_RENEW_WITHIN as q } from "./renew-within.js";
|
|
8
|
+
import { issuer as B } from "./issuer.js";
|
|
9
|
+
import { rewriteOrigin as Ie } from "./issuer.js";
|
|
10
|
+
import { keyedSingleFlight as R } from "./single-flight.js";
|
|
11
|
+
import { statelessStore as Q } from "./store.js";
|
|
12
|
+
import { ticketStore as Oe } from "./store.js";
|
|
13
|
+
import { AuthError as p } from "./types.js";
|
|
14
|
+
const ee = "openid profile email organization:*", te = 480 * 60, ne = 600, oe = /^[A-Za-z0-9_-]{16,128}$/, se = "http://schemas.openid.net/event/backchannel-logout", ie = "urn:ietf:params:oauth:grant-type:token-exchange", z = "urn:ietf:params:oauth:token-type:access_token", ae = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,254}$/;
|
|
15
|
+
function f(i, c, a) {
|
|
16
|
+
throw new p(i, c, {}, a === void 0 ? void 0 : { cause: a });
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
if (typeof
|
|
19
|
-
const
|
|
20
|
-
return typeof
|
|
18
|
+
function v(i) {
|
|
19
|
+
if (typeof i != "object" || i === null || !("code" in i)) return;
|
|
20
|
+
const c = i.code;
|
|
21
|
+
return typeof c == "string" ? c : void 0;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
let
|
|
26
|
-
for (let u = 0; u < 4 && typeof
|
|
27
|
-
if (
|
|
28
|
-
|
|
23
|
+
function S(i) {
|
|
24
|
+
const c = v(i);
|
|
25
|
+
if (c === "OAUTH_JWT_CLAIM_COMPARISON_FAILED") {
|
|
26
|
+
let a = i;
|
|
27
|
+
for (let u = 0; u < 4 && typeof a == "object" && a !== null; u++) {
|
|
28
|
+
if (a.claim === "nonce") return !0;
|
|
29
|
+
a = a.cause;
|
|
29
30
|
}
|
|
30
31
|
return !1;
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return c === "OAUTH_INVALID_RESPONSE" && i instanceof Error && i.cause instanceof Error && i.cause.message.includes('"nonce"');
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
35
|
+
function re(i) {
|
|
36
|
+
return v(i) === "OAUTH_KEY_SELECTION_FAILED";
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
if (
|
|
38
|
+
function C(i) {
|
|
39
|
+
const c = v(i);
|
|
40
|
+
if (c === "OAUTH_TIMEOUT" || c === "ERR_JWKS_TIMEOUT") return "idp/silent";
|
|
41
|
+
if (c === "OAUTH_RESPONSE_IS_NOT_CONFORM" || c === "ERR_JWKS_INVALID" || c === "ERR_JOSE_GENERIC" || i instanceof TypeError && c === void 0) return "idp/unreachable";
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
return typeof
|
|
43
|
+
function ce(i) {
|
|
44
|
+
return typeof i == "object" && i !== null && i.error === "invalid_grant";
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
return [...(
|
|
46
|
+
function de(i, c) {
|
|
47
|
+
return [...(i ?? ee).split(/\s+/).filter((u) => u !== "" && u !== "organization" && !u.startsWith("organization:")), `organization:${c ?? "*"}`].join(" ");
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
-
function
|
|
50
|
-
const
|
|
49
|
+
const D = /^(\*|[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?)$/, le = R();
|
|
50
|
+
function fe(i) {
|
|
51
|
+
const c = (a) => async (...u) => {
|
|
51
52
|
try {
|
|
52
|
-
return await
|
|
53
|
+
return await a(...u);
|
|
53
54
|
} catch (h) {
|
|
54
|
-
if (h instanceof
|
|
55
|
+
if (h instanceof p && h.code === "session/irrevocable") throw h;
|
|
55
56
|
return f("session/unavailable", "the session store did not answer", h);
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
return {
|
|
59
|
-
put:
|
|
60
|
-
update:
|
|
61
|
-
get:
|
|
62
|
-
drop:
|
|
63
|
-
dropAll:
|
|
60
|
+
put: c((a) => i.put(a)),
|
|
61
|
+
update: c((a, u) => i.update(a, u)),
|
|
62
|
+
get: c((a) => i.get(a)),
|
|
63
|
+
drop: c((a) => i.drop(a)),
|
|
64
|
+
dropAll: c((a) => i.dropAll(a))
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
return new
|
|
70
|
-
},
|
|
67
|
+
function _e(i) {
|
|
68
|
+
const c = B(i), a = fe(i.store ?? Q()), u = Y, h = (t, n, e) => {
|
|
69
|
+
const s = C(t) ?? n;
|
|
70
|
+
return new p(s, e, s === "idp/silent" ? { after: u } : {}, { cause: t });
|
|
71
|
+
}, m = async () => {
|
|
71
72
|
try {
|
|
72
|
-
return await
|
|
73
|
+
return await c.configuration();
|
|
73
74
|
} catch (t) {
|
|
74
75
|
throw h(t, "idp/unreachable", "the IdP's discovery document could not be read");
|
|
75
76
|
}
|
|
76
|
-
},
|
|
77
|
+
}, g = O({
|
|
77
78
|
name: "kanzo-session",
|
|
78
|
-
secret:
|
|
79
|
-
maxAge:
|
|
80
|
-
}),
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
},
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const
|
|
79
|
+
secret: i.secret,
|
|
80
|
+
maxAge: i.maxAge ?? te
|
|
81
|
+
}), b = (t) => O({ name: `kanzo-auth.${t}`, secret: i.secret, maxAge: ne }), A = async (t) => {
|
|
82
|
+
const n = await g.read(t);
|
|
83
|
+
return n === null ? null : { ticket: n.ticket, record: await a.get(n.ticket) };
|
|
84
|
+
}, T = async (t, n = "session/absent") => (t !== void 0 && await a.drop(t), { ended: !0, code: n, cookies: t === void 0 ? [] : [g.clear()] }), x = (t, n) => {
|
|
85
|
+
const e = t.claims(), s = e === void 0 ? n == null ? void 0 : n.session : X(e, i);
|
|
86
|
+
s === void 0 && f("token/exchange-failed", "the token response carried no ID token, so it names nobody");
|
|
87
|
+
const o = t.expiresIn(), r = o === void 0 ? void 0 : Date.now() + o * 1e3, d = typeof (e == null ? void 0 : e.sid) == "string" ? e.sid : n == null ? void 0 : n.sid;
|
|
87
88
|
return {
|
|
88
|
-
session: { ...
|
|
89
|
-
sid:
|
|
89
|
+
session: { ...s, expiresAt: r ?? s.expiresAt },
|
|
90
|
+
sid: d,
|
|
90
91
|
accessToken: t.access_token,
|
|
91
|
-
accessTokenExpiresAt:
|
|
92
|
+
accessTokenExpiresAt: r,
|
|
92
93
|
// RFC 10017 requires rotation, so the newly issued token is the only one still valid. An
|
|
93
94
|
// authorization server that did not rotate returns none, and the one we hold stays good.
|
|
94
|
-
refreshToken: t.refresh_token ?? (
|
|
95
|
-
idToken: t.id_token ?? (
|
|
95
|
+
refreshToken: t.refresh_token ?? (n == null ? void 0 : n.refreshToken),
|
|
96
|
+
idToken: t.id_token ?? (n == null ? void 0 : n.idToken)
|
|
96
97
|
};
|
|
97
|
-
}, I = (t,
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
let
|
|
98
|
+
}, I = (t, n) => le(t, async () => {
|
|
99
|
+
const e = n.refreshToken;
|
|
100
|
+
if (e === void 0) return T(t);
|
|
101
|
+
let s;
|
|
101
102
|
try {
|
|
102
|
-
|
|
103
|
-
} catch (
|
|
104
|
-
if (
|
|
105
|
-
if (
|
|
106
|
-
throw h(
|
|
107
|
-
const
|
|
108
|
-
return (
|
|
103
|
+
s = await H(await m(), e);
|
|
104
|
+
} catch (d) {
|
|
105
|
+
if (d instanceof p) throw d;
|
|
106
|
+
if (C(d) !== void 0 || !ce(d))
|
|
107
|
+
throw h(d, "token/exchange-failed", "the token endpoint did not renew the session");
|
|
108
|
+
const l = await a.get(t);
|
|
109
|
+
return (l == null ? void 0 : l.refreshToken) !== void 0 && l.refreshToken !== e ? { record: l, renewed: { ended: !1, session: l.session, cookies: [] } } : T(t, "token/refused");
|
|
109
110
|
}
|
|
110
|
-
const
|
|
111
|
-
return
|
|
112
|
-
record:
|
|
111
|
+
const o = x(s, n), r = await a.update(t, o);
|
|
112
|
+
return r === null ? T(t) : {
|
|
113
|
+
record: o,
|
|
113
114
|
renewed: {
|
|
114
115
|
ended: !1,
|
|
115
|
-
session:
|
|
116
|
-
cookies:
|
|
116
|
+
session: o.session,
|
|
117
|
+
cookies: r === t ? [] : [await g.seal({ ticket: r })]
|
|
117
118
|
}
|
|
118
119
|
};
|
|
119
|
-
}),
|
|
120
|
+
}), N = async (t, n) => {
|
|
121
|
+
const e = await A(t);
|
|
122
|
+
if ((e == null ? void 0 : e.record) == null) return T(e == null ? void 0 : e.ticket);
|
|
123
|
+
const { ticket: s, record: o } = e, r = o.accessTokenExpiresAt !== void 0 && o.accessTokenExpiresAt - Date.now() <= n;
|
|
124
|
+
if (o.accessToken !== void 0 && !r)
|
|
125
|
+
return { ended: !1, accessToken: o.accessToken, session: o.session, cookies: [] };
|
|
126
|
+
const d = await I(s, o);
|
|
127
|
+
return "ended" in d ? d : (d.record.accessToken === void 0 && f("token/exchange-failed", "the token response carried no access token"), { ...d.renewed, accessToken: d.record.accessToken });
|
|
128
|
+
}, _ = /* @__PURE__ */ new Map(), U = R(), L = async (t, n, e) => {
|
|
129
|
+
const s = e === void 0 ? void 0 : `organization:${e}`;
|
|
130
|
+
let o;
|
|
131
|
+
try {
|
|
132
|
+
o = await Z(await m(), ie, {
|
|
133
|
+
subject_token: t,
|
|
134
|
+
subject_token_type: z,
|
|
135
|
+
requested_token_type: z,
|
|
136
|
+
scope: s === void 0 ? n : `${n} ${s}`
|
|
137
|
+
});
|
|
138
|
+
} catch (k) {
|
|
139
|
+
throw k instanceof p ? k : h(k, "token/exchange-failed", `the session's token was not exchanged for \`${n}\``);
|
|
140
|
+
}
|
|
141
|
+
s !== void 0 && o.scope !== void 0 && !o.scope.split(" ").includes(s) && f("organization/denied", `the realm did not grant \`${s}\`: the person is not a member`);
|
|
142
|
+
const r = o.expiresIn(), d = {
|
|
143
|
+
accessToken: o.access_token,
|
|
144
|
+
expiresAt: r === void 0 ? void 0 : Date.now() + r * 1e3
|
|
145
|
+
}, l = Date.now();
|
|
146
|
+
for (const [k, y] of _)
|
|
147
|
+
y.expiresAt !== void 0 && y.expiresAt <= l && _.delete(k);
|
|
148
|
+
return _.set([t, n, e ?? ""].join(" "), d), d;
|
|
149
|
+
}, j = (t) => t instanceof p ? t : h(t, "token/refused", "the logout token did not verify");
|
|
120
150
|
return {
|
|
121
151
|
async begin(t) {
|
|
122
|
-
const
|
|
123
|
-
t.organization !== void 0 && !
|
|
152
|
+
const n = await m(), e = M(), s = P(), o = K();
|
|
153
|
+
t.organization !== void 0 && !D.test(t.organization) && f(
|
|
124
154
|
"organization/invalid",
|
|
125
155
|
`\`${t.organization}\` is not an organization alias, and a scope is a space-delimited list: see ORGANIZATION`
|
|
126
156
|
);
|
|
127
|
-
const
|
|
157
|
+
const r = {
|
|
128
158
|
redirect_uri: t.redirectUri,
|
|
129
|
-
scope:
|
|
130
|
-
code_challenge: await
|
|
159
|
+
scope: de(i.scope, t.organization),
|
|
160
|
+
code_challenge: await W(e),
|
|
131
161
|
code_challenge_method: "S256",
|
|
132
|
-
state:
|
|
133
|
-
nonce:
|
|
162
|
+
state: s,
|
|
163
|
+
nonce: o
|
|
134
164
|
};
|
|
135
165
|
return {
|
|
136
|
-
url:
|
|
166
|
+
url: F(n, r).href,
|
|
137
167
|
cookies: [
|
|
138
|
-
await
|
|
168
|
+
await b(s).seal({ state: s, nonce: o, verifier: e, returnTo: t.returnTo ?? "/" })
|
|
139
169
|
]
|
|
140
170
|
};
|
|
141
171
|
},
|
|
142
172
|
async complete(t) {
|
|
143
|
-
const
|
|
144
|
-
(
|
|
145
|
-
const
|
|
146
|
-
(
|
|
173
|
+
const n = new URL(t.url), e = n.searchParams.get("state");
|
|
174
|
+
(e === null || !oe.test(e)) && f("callback/state-mismatch", "the callback carries no `state` this client could have sent");
|
|
175
|
+
const s = b(e), o = await s.read(t.cookie);
|
|
176
|
+
(o === null || o.state !== e) && f(
|
|
147
177
|
"callback/state-mismatch",
|
|
148
178
|
"the callback's `state` names no transaction this browser started"
|
|
149
179
|
);
|
|
150
|
-
const
|
|
151
|
-
pkceCodeVerifier:
|
|
152
|
-
expectedState:
|
|
153
|
-
expectedNonce:
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
let
|
|
180
|
+
const r = {
|
|
181
|
+
pkceCodeVerifier: o.verifier,
|
|
182
|
+
expectedState: o.state,
|
|
183
|
+
expectedNonce: o.nonce
|
|
184
|
+
}, d = new URL(t.redirectUri);
|
|
185
|
+
d.search = n.search;
|
|
186
|
+
const l = (w) => V(w, d, r);
|
|
187
|
+
let k;
|
|
158
188
|
try {
|
|
159
|
-
|
|
160
|
-
} catch (
|
|
161
|
-
if (
|
|
162
|
-
if (
|
|
189
|
+
k = await l(await m());
|
|
190
|
+
} catch (w) {
|
|
191
|
+
if (w instanceof p) throw w;
|
|
192
|
+
if (S(w) && f(
|
|
163
193
|
"callback/nonce-mismatch",
|
|
164
194
|
"the ID token's `nonce` is not the one this transaction sent",
|
|
165
|
-
|
|
166
|
-
), !
|
|
167
|
-
throw h(
|
|
195
|
+
w
|
|
196
|
+
), !re(w))
|
|
197
|
+
throw h(w, "token/exchange-failed", "the authorization code could not be exchanged");
|
|
168
198
|
try {
|
|
169
|
-
|
|
170
|
-
} catch (
|
|
171
|
-
throw
|
|
199
|
+
k = await l(await c.rediscover());
|
|
200
|
+
} catch (E) {
|
|
201
|
+
throw S(E) && f(
|
|
172
202
|
"callback/nonce-mismatch",
|
|
173
203
|
"the ID token's `nonce` is not the one this transaction sent",
|
|
174
|
-
|
|
204
|
+
E
|
|
175
205
|
), h(
|
|
176
|
-
|
|
206
|
+
E,
|
|
177
207
|
"token/exchange-failed",
|
|
178
208
|
"the ID token did not verify, and did not verify against freshly discovered keys either"
|
|
179
209
|
);
|
|
180
210
|
}
|
|
181
211
|
}
|
|
182
|
-
const
|
|
212
|
+
const y = x(k, null), $ = await a.put(y);
|
|
183
213
|
return {
|
|
184
|
-
session:
|
|
185
|
-
cookies: [await
|
|
186
|
-
returnTo:
|
|
214
|
+
session: y.session,
|
|
215
|
+
cookies: [await g.seal({ ticket: $ }), s.clear()],
|
|
216
|
+
returnTo: o.returnTo
|
|
187
217
|
};
|
|
188
218
|
},
|
|
189
219
|
async read(t) {
|
|
190
|
-
var
|
|
191
|
-
return ((
|
|
220
|
+
var n, e;
|
|
221
|
+
return ((e = (n = await A(t)) == null ? void 0 : n.record) == null ? void 0 : e.session) ?? null;
|
|
192
222
|
},
|
|
193
|
-
async token(t,
|
|
194
|
-
const
|
|
195
|
-
if ((
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
223
|
+
async token(t, n) {
|
|
224
|
+
const { audience: e, organization: s } = n;
|
|
225
|
+
if (!ae.test(e))
|
|
226
|
+
throw new Error(`\`${e}\` is not a client id, and a scope is a space-delimited list`);
|
|
227
|
+
s !== void 0 && (s === "*" || !D.test(s)) && f(
|
|
228
|
+
"organization/invalid",
|
|
229
|
+
`\`${s}\` is not one organization alias, and a token is for one organization`
|
|
230
|
+
);
|
|
231
|
+
const o = (n.renewWithin ?? q) * 1e3, r = await N(t, o);
|
|
232
|
+
if (r.ended) return r;
|
|
233
|
+
const d = [r.accessToken, e, s ?? ""].join(" "), l = _.get(d), k = l !== void 0 && (l.expiresAt === void 0 || l.expiresAt - Date.now() > o) ? l : await U(d, () => L(r.accessToken, e, s));
|
|
234
|
+
return { ended: !1, session: r.session, cookies: r.cookies, accessToken: k.accessToken };
|
|
201
235
|
},
|
|
202
|
-
async refresh(t) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
236
|
+
async refresh(t, n = {}) {
|
|
237
|
+
if (n.renewWithin !== void 0) {
|
|
238
|
+
const o = await N(t, n.renewWithin * 1e3);
|
|
239
|
+
return o.ended ? o : { ended: !1, session: o.session, cookies: o.cookies };
|
|
240
|
+
}
|
|
241
|
+
const e = await A(t);
|
|
242
|
+
if ((e == null ? void 0 : e.record) == null) return T(e == null ? void 0 : e.ticket);
|
|
243
|
+
const s = await I(e.ticket, e.record);
|
|
244
|
+
return "ended" in s ? s : s.renewed;
|
|
207
245
|
},
|
|
208
|
-
async end(t,
|
|
209
|
-
var
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
return
|
|
214
|
-
url:
|
|
215
|
-
cookies: [
|
|
246
|
+
async end(t, n = {}) {
|
|
247
|
+
var r;
|
|
248
|
+
const e = await A(t);
|
|
249
|
+
e !== null && await a.drop(e.ticket);
|
|
250
|
+
const s = {}, o = n.returnTo ?? i.postLogoutRedirectUri;
|
|
251
|
+
return o !== void 0 && (s.post_logout_redirect_uri = o), ((r = e == null ? void 0 : e.record) == null ? void 0 : r.idToken) !== void 0 && (s.id_token_hint = e.record.idToken), {
|
|
252
|
+
url: G(await m(), s).href,
|
|
253
|
+
cookies: [g.clear()]
|
|
216
254
|
};
|
|
217
255
|
},
|
|
218
256
|
async logout(t) {
|
|
219
|
-
let
|
|
257
|
+
let n;
|
|
220
258
|
try {
|
|
221
|
-
({ payload:
|
|
222
|
-
issuer:
|
|
223
|
-
audience:
|
|
259
|
+
({ payload: n } = await J(t, await c.keys(), {
|
|
260
|
+
issuer: i.issuer,
|
|
261
|
+
audience: i.clientId,
|
|
224
262
|
requiredClaims: ["iat"]
|
|
225
263
|
}));
|
|
226
|
-
} catch (
|
|
227
|
-
throw
|
|
264
|
+
} catch (d) {
|
|
265
|
+
throw j(d);
|
|
228
266
|
}
|
|
229
|
-
const
|
|
230
|
-
(typeof
|
|
231
|
-
const
|
|
232
|
-
|
|
267
|
+
const e = n.events, s = typeof e == "object" && e !== null ? e[se] : void 0;
|
|
268
|
+
(typeof s != "object" || s === null) && f("token/refused", "the logout token does not carry the back-channel logout event"), "nonce" in n && f("token/refused", "a logout token must not carry a `nonce`");
|
|
269
|
+
const o = typeof n.sub == "string" ? n.sub : void 0, r = typeof n.sid == "string" ? n.sid : void 0;
|
|
270
|
+
o === void 0 && f(
|
|
233
271
|
"token/refused",
|
|
234
|
-
|
|
235
|
-
), await
|
|
272
|
+
r === void 0 ? "the logout token names neither a subject nor a session" : "the logout token names a session but no subject, and sessions are found by subject"
|
|
273
|
+
), await a.dropAll({ sub: o, sid: r });
|
|
236
274
|
}
|
|
237
275
|
};
|
|
238
276
|
}
|
|
239
277
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
278
|
+
be as cookieValue,
|
|
279
|
+
B as issuer,
|
|
280
|
+
_e as relyingParty,
|
|
281
|
+
Ie as rewriteOrigin,
|
|
282
|
+
O as sealedCookie,
|
|
283
|
+
Q as statelessStore,
|
|
284
|
+
Oe as ticketStore
|
|
247
285
|
};
|
|
248
286
|
//# sourceMappingURL=server.js.map
|