@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/server.js CHANGED
@@ -1,248 +1,286 @@
1
- import { buildEndSessionUrl as R, randomPKCECodeVerifier as C, randomState as U, randomNonce as D, calculatePKCECodeChallenge as L, buildAuthorizationUrl as j, refreshTokenGrant as M, authorizationCodeGrant as P } from "openid-client";
2
- import { jwtVerify as F } from "jose";
3
- import { claims as G } from "./claims.js";
4
- import { sealedCookie as N } from "./cookie-session.js";
5
- import { cookieValue as we } from "./cookie-session.js";
6
- import { DEADLINE as H } from "./deadline.js";
7
- import { issuer as K } from "./issuer.js";
8
- import { rewriteOrigin as Te } from "./issuer.js";
9
- import { keyedSingleFlight as V } from "./single-flight.js";
10
- import { statelessStore as W } from "./store.js";
11
- import { ticketStore as ye } from "./store.js";
12
- import { AuthError as m } from "./types.js";
13
- const Z = "openid profile email organization:*", $ = 480 * 60, J = 600, X = /^[A-Za-z0-9_-]{16,128}$/, B = "http://schemas.openid.net/event/backchannel-logout", Y = 60;
14
- function f(o, a, s) {
15
- throw new m(o, a, {}, s === void 0 ? void 0 : { cause: s });
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 _(o) {
18
- if (typeof o != "object" || o === null || !("code" in o)) return;
19
- const a = o.code;
20
- return typeof a == "string" ? a : void 0;
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 O(o) {
23
- const a = _(o);
24
- if (a === "OAUTH_JWT_CLAIM_COMPARISON_FAILED") {
25
- let s = o;
26
- for (let u = 0; u < 4 && typeof s == "object" && s !== null; u++) {
27
- if (s.claim === "nonce") return !0;
28
- s = s.cause;
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 a === "OAUTH_INVALID_RESPONSE" && o instanceof Error && o.cause instanceof Error && o.cause.message.includes('"nonce"');
33
+ return c === "OAUTH_INVALID_RESPONSE" && i instanceof Error && i.cause instanceof Error && i.cause.message.includes('"nonce"');
33
34
  }
34
- function Q(o) {
35
- return _(o) === "OAUTH_KEY_SELECTION_FAILED";
35
+ function re(i) {
36
+ return v(i) === "OAUTH_KEY_SELECTION_FAILED";
36
37
  }
37
- function x(o) {
38
- const a = _(o);
39
- if (a === "OAUTH_TIMEOUT" || a === "ERR_JWKS_TIMEOUT") return "idp/silent";
40
- if (a === "OAUTH_RESPONSE_IS_NOT_CONFORM" || a === "ERR_JWKS_INVALID" || a === "ERR_JOSE_GENERIC" || o instanceof TypeError && a === void 0) return "idp/unreachable";
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 q(o) {
43
- return typeof o == "object" && o !== null && o.error === "invalid_grant";
43
+ function ce(i) {
44
+ return typeof i == "object" && i !== null && i.error === "invalid_grant";
44
45
  }
45
- function ee(o, a) {
46
- return [...(o ?? Z).split(/\s+/).filter((u) => u !== "" && u !== "organization" && !u.startsWith("organization:")), `organization:${a ?? "*"}`].join(" ");
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 te = /^(\*|[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?)$/, ne = V();
49
- function oe(o) {
50
- const a = (s) => async (...u) => {
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 s(...u);
53
+ return await a(...u);
53
54
  } catch (h) {
54
- if (h instanceof m && h.code === "session/irrevocable") throw h;
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: a((s) => o.put(s)),
60
- update: a((s, u) => o.update(s, u)),
61
- get: a((s) => o.get(s)),
62
- drop: a((s) => o.drop(s)),
63
- dropAll: a((s) => o.dropAll(s))
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 he(o) {
67
- const a = K(o), s = oe(o.store ?? W()), u = H, h = (t, e, n) => {
68
- const i = x(t) ?? e;
69
- return new m(i, n, i === "idp/silent" ? { after: u } : {}, { cause: t });
70
- }, T = async () => {
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 a.configuration();
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
- }, w = N({
77
+ }, g = O({
77
78
  name: "kanzo-session",
78
- secret: o.secret,
79
- maxAge: o.maxAge ?? $
80
- }), E = (t) => N({ name: `kanzo-auth.${t}`, secret: o.secret, maxAge: J }), g = async (t) => {
81
- const e = await w.read(t);
82
- return e === null ? null : { ticket: e.ticket, record: await s.get(e.ticket) };
83
- }, p = async (t, e = "session/absent") => (t !== void 0 && await s.drop(t), { ended: !0, code: e, cookies: t === void 0 ? [] : [w.clear()] }), b = (t, e) => {
84
- const n = t.claims(), i = n === void 0 ? e == null ? void 0 : e.session : G(n, o);
85
- i === void 0 && f("token/exchange-failed", "the token response carried no ID token, so it names nobody");
86
- const r = t.expiresIn(), c = r === void 0 ? void 0 : Date.now() + r * 1e3, l = typeof (n == null ? void 0 : n.sid) == "string" ? n.sid : e == null ? void 0 : e.sid;
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: { ...i, expiresAt: c ?? i.expiresAt },
89
- sid: l,
89
+ session: { ...s, expiresAt: r ?? s.expiresAt },
90
+ sid: d,
90
91
  accessToken: t.access_token,
91
- accessTokenExpiresAt: c,
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 ?? (e == null ? void 0 : e.refreshToken),
95
- idToken: t.id_token ?? (e == null ? void 0 : e.idToken)
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, e) => ne(t, async () => {
98
- const n = e.refreshToken;
99
- if (n === void 0) return p(t);
100
- let i;
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
- i = await M(await T(), n);
103
- } catch (l) {
104
- if (l instanceof m) throw l;
105
- if (x(l) !== void 0 || !q(l))
106
- throw h(l, "token/exchange-failed", "the token endpoint did not renew the session");
107
- const d = await s.get(t);
108
- return (d == null ? void 0 : d.refreshToken) !== void 0 && d.refreshToken !== n ? { record: d, renewed: { ended: !1, session: d.session, cookies: [] } } : p(t, "token/refused");
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 r = b(i, e), c = await s.update(t, r);
111
- return c === null ? p(t) : {
112
- record: r,
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: r.session,
116
- cookies: c === t ? [] : [await w.seal({ ticket: c })]
116
+ session: o.session,
117
+ cookies: r === t ? [] : [await g.seal({ ticket: r })]
117
118
  }
118
119
  };
119
- }), S = (t) => t instanceof m ? t : h(t, "token/refused", "the logout token did not verify");
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 e = await T(), n = C(), i = U(), r = D();
123
- t.organization !== void 0 && !te.test(t.organization) && f(
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 c = {
157
+ const r = {
128
158
  redirect_uri: t.redirectUri,
129
- scope: ee(o.scope, t.organization),
130
- code_challenge: await L(n),
159
+ scope: de(i.scope, t.organization),
160
+ code_challenge: await W(e),
131
161
  code_challenge_method: "S256",
132
- state: i,
133
- nonce: r
162
+ state: s,
163
+ nonce: o
134
164
  };
135
165
  return {
136
- url: j(e, c).href,
166
+ url: F(n, r).href,
137
167
  cookies: [
138
- await E(i).seal({ state: i, nonce: r, verifier: n, returnTo: t.returnTo ?? "/" })
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 e = new URL(t.url), n = e.searchParams.get("state");
144
- (n === null || !X.test(n)) && f("callback/state-mismatch", "the callback carries no `state` this client could have sent");
145
- const i = E(n), r = await i.read(t.cookie);
146
- (r === null || r.state !== n) && f(
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 c = {
151
- pkceCodeVerifier: r.verifier,
152
- expectedState: r.state,
153
- expectedNonce: r.nonce
154
- }, l = new URL(t.redirectUri);
155
- l.search = e.search;
156
- const d = (k) => P(k, l, c);
157
- let y;
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
- y = await d(await T());
160
- } catch (k) {
161
- if (k instanceof m) throw k;
162
- if (O(k) && f(
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
- k
166
- ), !Q(k))
167
- throw h(k, "token/exchange-failed", "the authorization code could not be exchanged");
195
+ w
196
+ ), !re(w))
197
+ throw h(w, "token/exchange-failed", "the authorization code could not be exchanged");
168
198
  try {
169
- y = await d(await a.rediscover());
170
- } catch (A) {
171
- throw O(A) && f(
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
- A
204
+ E
175
205
  ), h(
176
- A,
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 v = b(y, null), z = await s.put(v);
212
+ const y = x(k, null), $ = await a.put(y);
183
213
  return {
184
- session: v.session,
185
- cookies: [await w.seal({ ticket: z }), i.clear()],
186
- returnTo: r.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 e, n;
191
- return ((n = (e = await g(t)) == null ? void 0 : e.record) == null ? void 0 : n.session) ?? null;
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, e = {}) {
194
- const n = await g(t);
195
- if ((n == null ? void 0 : n.record) == null) return p(n == null ? void 0 : n.ticket);
196
- const { ticket: i, record: r } = n, c = (e.renewWithin ?? Y) * 1e3, l = r.accessTokenExpiresAt !== void 0 && r.accessTokenExpiresAt - Date.now() <= c;
197
- if (r.accessToken !== void 0 && !l)
198
- return { ended: !1, accessToken: r.accessToken, session: r.session, cookies: [] };
199
- const d = await I(i, r);
200
- 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 });
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
- const e = await g(t);
204
- if ((e == null ? void 0 : e.record) == null) return p(e == null ? void 0 : e.ticket);
205
- const n = await I(e.ticket, e.record);
206
- return "ended" in n ? n : n.renewed;
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, e = {}) {
209
- var c;
210
- const n = await g(t);
211
- n !== null && await s.drop(n.ticket);
212
- const i = {}, r = e.returnTo ?? o.postLogoutRedirectUri;
213
- return r !== void 0 && (i.post_logout_redirect_uri = r), ((c = n == null ? void 0 : n.record) == null ? void 0 : c.idToken) !== void 0 && (i.id_token_hint = n.record.idToken), {
214
- url: R(await T(), i).href,
215
- cookies: [w.clear()]
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 e;
257
+ let n;
220
258
  try {
221
- ({ payload: e } = await F(t, await a.keys(), {
222
- issuer: o.issuer,
223
- audience: o.clientId,
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 (l) {
227
- throw S(l);
264
+ } catch (d) {
265
+ throw j(d);
228
266
  }
229
- const n = e.events, i = typeof n == "object" && n !== null ? n[B] : void 0;
230
- (typeof i != "object" || i === null) && f("token/refused", "the logout token does not carry the back-channel logout event"), "nonce" in e && f("token/refused", "a logout token must not carry a `nonce`");
231
- const r = typeof e.sub == "string" ? e.sub : void 0, c = typeof e.sid == "string" ? e.sid : void 0;
232
- r === void 0 && f(
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
- c === 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"
235
- ), await s.dropAll({ sub: r, sid: c });
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
- we as cookieValue,
241
- K as issuer,
242
- he as relyingParty,
243
- Te as rewriteOrigin,
244
- N as sealedCookie,
245
- W as statelessStore,
246
- ye as ticketStore
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