authhero 9.37.0 → 9.39.0

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 (86) hide show
  1. package/README.md +13 -3
  2. package/dist/assets/u/widget/authhero-widget.esm.js +1 -1
  3. package/dist/assets/u/widget/index.esm.js +1 -1
  4. package/dist/assets/u/widget/{p-ce8560f6.entry.js → p-32247347.entry.js} +1 -1
  5. package/dist/assets/u/widget/p-3f908508.entry.js +1 -0
  6. package/dist/assets/u/widget/p-Wx4M-olY.js +2 -0
  7. package/dist/authhero.cjs +116 -95
  8. package/dist/authhero.d.ts +469 -306
  9. package/dist/authhero.mjs +17889 -16773
  10. package/dist/mfa-DMThiuUR.mjs +406 -0
  11. package/dist/mfa-Dh6nNiRX.js +4 -0
  12. package/dist/mfa-attempts-BaKbuGvZ.js +321 -0
  13. package/dist/{mfa-attempts-DDgCBTDW.mjs → mfa-attempts-O0x4jJzl.mjs} +6234 -6126
  14. package/dist/{passkey-enrollment-D6ZZmelw.js → passkey-enrollment-CSeOQWv1.js} +1 -1
  15. package/dist/tsconfig.types.tsbuildinfo +1 -1
  16. package/dist/types/authentication-flows/mfa.d.ts +3 -1
  17. package/dist/types/emails/index.d.ts +33 -1
  18. package/dist/types/helpers/default-destinations.d.ts +14 -0
  19. package/dist/types/helpers/firehose-client.d.ts +29 -0
  20. package/dist/types/helpers/outbox-destinations/log-streams.d.ts +21 -1
  21. package/dist/types/helpers/prompt-partials.d.ts +1 -1
  22. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  23. package/dist/types/helpers/response-type-grants.d.ts +8 -0
  24. package/dist/types/helpers/run-outbox-relay.d.ts +9 -2
  25. package/dist/types/hooks/custom-notification-provider.d.ts +174 -0
  26. package/dist/types/hooks/lifecycle-codehooks.d.ts +2 -2
  27. package/dist/types/index.d.ts +431 -295
  28. package/dist/types/routes/auth-api/device.d.ts +8 -8
  29. package/dist/types/routes/auth-api/index.d.ts +30 -30
  30. package/dist/types/routes/auth-api/passwordless.d.ts +16 -16
  31. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  32. package/dist/types/routes/management-api/action-executions.d.ts +2 -2
  33. package/dist/types/routes/management-api/action-triggers.d.ts +27 -27
  34. package/dist/types/routes/management-api/actions.d.ts +14 -14
  35. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  36. package/dist/types/routes/management-api/branding-preview.d.ts +9 -1
  37. package/dist/types/routes/management-api/branding-uploads.d.ts +4 -4
  38. package/dist/types/routes/management-api/branding.d.ts +125 -21
  39. package/dist/types/routes/management-api/client-registration-tokens.d.ts +3 -3
  40. package/dist/types/routes/management-api/clients.d.ts +18 -18
  41. package/dist/types/routes/management-api/connections.d.ts +8 -8
  42. package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
  43. package/dist/types/routes/management-api/emails.d.ts +6 -6
  44. package/dist/types/routes/management-api/failed-events.d.ts +2 -2
  45. package/dist/types/routes/management-api/guardian.d.ts +6 -6
  46. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  47. package/dist/types/routes/management-api/hooks.d.ts +56 -56
  48. package/dist/types/routes/management-api/index.d.ts +362 -258
  49. package/dist/types/routes/management-api/jobs.d.ts +2 -2
  50. package/dist/types/routes/management-api/keys.d.ts +12 -12
  51. package/dist/types/routes/management-api/log-streams.d.ts +12 -12
  52. package/dist/types/routes/management-api/logs.d.ts +4 -4
  53. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  54. package/dist/types/routes/management-api/organizations.d.ts +5 -5
  55. package/dist/types/routes/management-api/prompts.d.ts +8 -8
  56. package/dist/types/routes/management-api/resource-servers.d.ts +8 -8
  57. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  58. package/dist/types/routes/management-api/self-service-profiles.d.ts +9 -9
  59. package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
  60. package/dist/types/routes/management-api/tenant-members.d.ts +8 -8
  61. package/dist/types/routes/management-api/tenant-operations.d.ts +10 -10
  62. package/dist/types/routes/management-api/tenants.d.ts +13 -13
  63. package/dist/types/routes/management-api/themes.d.ts +78 -9
  64. package/dist/types/routes/management-api/users.d.ts +20 -20
  65. package/dist/types/routes/universal-login/common.d.ts +62 -10
  66. package/dist/types/routes/universal-login/continue.d.ts +35 -0
  67. package/dist/types/routes/universal-login/dark-theme.d.ts +25 -0
  68. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  69. package/dist/types/routes/universal-login/index.d.ts +2 -2
  70. package/dist/types/routes/universal-login/legal-links.d.ts +18 -0
  71. package/dist/types/routes/universal-login/screen-prompt-map.d.ts +31 -0
  72. package/dist/types/routes/universal-login/screens/connect-authz.d.ts +13 -1
  73. package/dist/types/routes/universal-login/screens/login-partials.d.ts +9 -1
  74. package/dist/types/routes/universal-login/u2-index.d.ts +36 -5
  75. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  76. package/dist/types/routes/universal-login/u2-widget-page.d.ts +6 -1
  77. package/dist/types/routes/universal-login/universal-login-template.d.ts +1 -0
  78. package/dist/types/routes/universal-login/widget-assets.d.ts +20 -0
  79. package/dist/types/state-machines/login-session.d.ts +1 -1
  80. package/dist/types/types/AuthHeroConfig.d.ts +9 -1
  81. package/package.json +7 -6
  82. package/dist/assets/u/widget/p-FUW5zvoZ.js +0 -2
  83. package/dist/assets/u/widget/p-c6ec4c36.entry.js +0 -1
  84. package/dist/mfa-BpHxTir1.mjs +0 -128
  85. package/dist/mfa-DuNbh_YF.js +0 -1
  86. package/dist/mfa-attempts-D5U1FCSY.js +0 -275
package/README.md CHANGED
@@ -26,17 +26,27 @@ Authhero consists of several npm packages that provide different authentication-
26
26
  To initialize an auth server using Authhero:
27
27
 
28
28
  ```javascript
29
- const { managementApp, oauthApp, universalApp, samlApp } = init({
29
+ import { init, createWidgetAssetRoutes } from "authhero";
30
+
31
+ const config = {
30
32
  dataAdapter: params.dataAdapter,
31
- });
33
+ // Serves the widget bundle (see `widgetHandler` in AuthHeroConfig).
34
+ widgetHandler: params.widgetHandler,
35
+ };
36
+ const { managementApp, oauthApp, universalApp, u2App, samlApp } = init(config);
32
37
 
33
38
  rootApp
34
- .route("/", oauthApp)
39
+ // Mount the widget assets first and mount the universal login apps before oauthApp, so they skip oauthApp's per-request tenant middleware.
40
+ .route("/", createWidgetAssetRoutes(config))
35
41
  .route("/u", universalApp)
42
+ .route("/u2", u2App)
43
+ .route("/", oauthApp)
36
44
  .route("/api/v2", managementApp)
37
45
  .route("/", samlApp);
38
46
  ```
39
47
 
48
+ The login pages load the widget from `/widget/*` and `/widget/client.js` (`/u/widget/*` is kept as an alias). Those routes are registered on the root `app` returned by `init()`. When you compose the routers yourself, as above, mount `createWidgetAssetRoutes` at the root (or serve `/widget/*` yourself). Without a `widgetHandler`, `/widget/authhero-widget.esm.js` returns `404 widget_not_configured`.
49
+
40
50
  ## Data Adapters
41
51
 
42
52
  Authhero uses data adapters to handle persistence. The default adapter is `@authhero/kysely`, which connects to any SQL database using Kysely. Future versions will migrate to Drizzle as the default data adapter. You can also create custom adapters, such as DynamoDB + Elasticsearch.
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-FUW5zvoZ.js";export{s as setNonce}from"./p-FUW5zvoZ.js";import{g as t}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await t(),a([["p-c6ec4c36",[[513,"authhero-node",{component:[16],value:[1],disabled:[4],locale:[1],passwordVisible:[32],selectedCountry:[32],localPhoneNumber:[32],countryDropdownOpen:[32],telEmailMode:[32],dateSegments:[32]},null,{component:[{componentChanged:0}],value:[{valueChanged:0}]}]]],["p-ce8560f6",[[513,"authhero-widget",{screen:[1],apiUrl:[1,"api-url"],baseUrl:[1,"base-url"],state:[1025],screenId:[1025,"screen-id"],authParams:[1,"auth-params"],statePersistence:[1,"state-persistence"],storageKey:[1,"storage-key"],branding:[1],theme:[1],loading:[1028],autoSubmit:[4,"auto-submit"],autoNavigate:[4,"auto-navigate"],locale:[1],_screen:[32],_authParams:[32],_branding:[32],_theme:[32],formData:[32],listFilter:[32]},null,{screenId:[{watchScreenId:0}],screen:[{watchScreen:0}],branding:[{watchBranding:0}],theme:[{watchTheme:0}],authParams:[{watchAuthParams:0}]}]]]],e))));
1
+ import{p as e,b as a}from"./p-Wx4M-olY.js";export{s as setNonce}from"./p-Wx4M-olY.js";import{g as t}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await t(),a([["p-3f908508",[[513,"authhero-node",{component:[16],value:[1],disabled:[4],locale:[1],passwordVisible:[32],selectedCountry:[32],localPhoneNumber:[32],countryDropdownOpen:[32],telEmailMode:[32],dateSegments:[32]},null,{component:[{componentChanged:0}],value:[{valueChanged:0}]}]]],["p-32247347",[[513,"authhero-widget",{screen:[1],apiUrl:[1,"api-url"],baseUrl:[1,"base-url"],state:[1025],screenId:[1025,"screen-id"],authParams:[1,"auth-params"],statePersistence:[1,"state-persistence"],storageKey:[1,"storage-key"],branding:[1],theme:[1],loading:[1028],autoSubmit:[4,"auto-submit"],autoNavigate:[4,"auto-navigate"],locale:[1],_screen:[32],_authParams:[32],_branding:[32],_theme:[32],formData:[32],listFilter:[32]},null,{screenId:[{watchScreenId:0}],screen:[{watchScreen:0}],branding:[{watchBranding:0}],theme:[{watchTheme:0}],authParams:[{watchAuthParams:0}]}]]]],e))));