authhero 8.17.1 → 8.17.2

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.
Files changed (31) hide show
  1. package/dist/authhero.cjs +3 -3
  2. package/dist/authhero.d.ts +233 -233
  3. package/dist/authhero.mjs +18 -14
  4. package/dist/tsconfig.types.tsbuildinfo +1 -1
  5. package/dist/types/authentication-flows/passwordless.d.ts +5 -5
  6. package/dist/types/index.d.ts +233 -233
  7. package/dist/types/routes/auth-api/authorize.d.ts +14 -14
  8. package/dist/types/routes/auth-api/index.d.ts +50 -50
  9. package/dist/types/routes/auth-api/passwordless.d.ts +4 -4
  10. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  11. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  12. package/dist/types/routes/management-api/branding.d.ts +5 -5
  13. package/dist/types/routes/management-api/clients.d.ts +6 -6
  14. package/dist/types/routes/management-api/connections.d.ts +15 -15
  15. package/dist/types/routes/management-api/failed-events.d.ts +1 -1
  16. package/dist/types/routes/management-api/index.d.ts +53 -53
  17. package/dist/types/routes/management-api/log-streams.d.ts +6 -6
  18. package/dist/types/routes/management-api/logs.d.ts +3 -3
  19. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  20. package/dist/types/routes/management-api/organizations.d.ts +3 -3
  21. package/dist/types/routes/management-api/prompts.d.ts +4 -4
  22. package/dist/types/routes/management-api/tenants.d.ts +6 -6
  23. package/dist/types/routes/management-api/themes.d.ts +3 -3
  24. package/dist/types/routes/management-api/users.d.ts +2 -2
  25. package/dist/types/routes/universal-login/common.d.ts +2 -2
  26. package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
  27. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  28. package/dist/types/routes/universal-login/index.d.ts +2 -2
  29. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  30. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  31. package/package.json +5 -5
package/dist/authhero.mjs CHANGED
@@ -8663,7 +8663,7 @@ var hne = (e, t) => {
8663
8663
  }, af = (e, t, n, r) => {
8664
8664
  let i = bne(t, n, r);
8665
8665
  e.header("Set-Cookie", i, { append: !0 });
8666
- }, of = "mrb21yjo", xne = /* @__PURE__ */ p({
8666
+ }, of = "mrby3tmz", xne = /* @__PURE__ */ p({
8667
8667
  common: () => sf,
8668
8668
  consent: () => cf,
8669
8669
  default: () => Sne,
@@ -34475,7 +34475,8 @@ async function OL(e, t) {
34475
34475
  client: r,
34476
34476
  loginSession: t.loginSession,
34477
34477
  existingSessionId: t.existingSessionIdToLink,
34478
- authConnection: t.authConnection
34478
+ authConnection: t.authConnection,
34479
+ authStrategy: t.authStrategy
34479
34480
  });
34480
34481
  let n = await e.env.data.loginSessions.get(r.tenant.id, t.loginSession.id);
34481
34482
  n && (u = n);
@@ -58282,6 +58283,7 @@ async function Z0({ ctx: e, client: t, session: n, redirect_uri: r, state: i, no
58282
58283
  expires_at: new Date(Date.now() + 300 * 1e3).toISOString(),
58283
58284
  session_id: n.id,
58284
58285
  ...re ? { auth_connection: re } : {},
58286
+ ...ne?.auth_strategy ? { auth_strategy: ne.auth_strategy } : {},
58285
58287
  ip: e.var.ip,
58286
58288
  useragent: e.var.useragent
58287
58289
  }), ae = p === void 0 ? void 0 : Math.floor(new Date(n.authenticated_at).getTime() / 1e3), D = {
@@ -58338,26 +58340,28 @@ async function Z0({ ctx: e, client: t, session: n, redirect_uri: r, state: i, no
58338
58340
  last_user_agent: e.var.useragent || ""
58339
58341
  },
58340
58342
  idle_expires_at: de
58341
- }), de && await m.data.loginSessions.update(t.tenant.id, ie.id, { expires_at: de }), P(e, t.tenant.id, {
58343
+ });
58344
+ let fe = Math.max(de ? new Date(de).getTime() : 0, n.expires_at ? new Date(n.expires_at).getTime() : 0);
58345
+ fe > Date.now() && await m.data.loginSessions.update(t.tenant.id, ie.id, { expires_at: new Date(fe).toISOString() }), P(e, t.tenant.id, {
58342
58346
  type: M.SUCCESS_SILENT_AUTH,
58343
58347
  description: "Successful silent authentication"
58344
58348
  });
58345
- let fe = new Headers();
58349
+ let pe = new Headers();
58346
58350
  if (DN(t.tenant.id, n.id, e.var.host).forEach((e) => {
58347
- fe.append("set-cookie", e);
58351
+ pe.append("set-cookie", e);
58348
58352
  }), _) return _P(e, g, JSON.stringify({
58349
58353
  ...ue,
58350
58354
  state: i
58351
- }), fe);
58352
- let pe = {}, me = ue.code, he = ue.access_token, ge = ue.id_token;
58353
- if (se && typeof me == "string" && (pe.code = me), typeof he == "string" && (O && (pe.access_token = he, typeof ue.token_type == "string" && (pe.token_type = ue.token_type), typeof ue.expires_in == "number" && (pe.expires_in = String(ue.expires_in))), ce && typeof ge == "string" && (pe.id_token = ge)), i && (pe.state = i), (O || ce) && l && (pe.scope = l), d === fn.FORM_POST) return yP(r, pe, fe);
58354
- let _e = new URL(r);
58355
- if (X0(u, d)) _e.hash = new URLSearchParams(pe).toString();
58356
- else for (let [e, t] of Object.entries(pe)) _e.searchParams.set(e, t);
58357
- let ve = { Location: _e.toString() }, ye = fe.get("set-cookie");
58358
- return ye && (ve["set-cookie"] = ye), new Response(null, {
58355
+ }), pe);
58356
+ let me = {}, he = ue.code, ge = ue.access_token, _e = ue.id_token;
58357
+ if (se && typeof he == "string" && (me.code = he), typeof ge == "string" && (O && (me.access_token = ge, typeof ue.token_type == "string" && (me.token_type = ue.token_type), typeof ue.expires_in == "number" && (me.expires_in = String(ue.expires_in))), ce && typeof _e == "string" && (me.id_token = _e)), i && (me.state = i), (O || ce) && l && (me.scope = l), d === fn.FORM_POST) return yP(r, me, pe);
58358
+ let ve = new URL(r);
58359
+ if (X0(u, d)) ve.hash = new URLSearchParams(me).toString();
58360
+ else for (let [e, t] of Object.entries(me)) ve.searchParams.set(e, t);
58361
+ let ye = { Location: ve.toString() }, be = pe.get("set-cookie");
58362
+ return be && (ye["set-cookie"] = be), new Response(null, {
58359
58363
  status: 302,
58360
- headers: ve
58364
+ headers: ye
58361
58365
  });
58362
58366
  }
58363
58367
  //#endregion