authhero 9.38.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 (69) hide show
  1. package/README.md +13 -3
  2. package/dist/assets/u/widget/index.esm.js +1 -1
  3. package/dist/authhero.cjs +85 -85
  4. package/dist/authhero.d.ts +624 -572
  5. package/dist/authhero.mjs +16355 -16196
  6. package/dist/mfa-DMThiuUR.mjs +406 -0
  7. package/dist/mfa-Dh6nNiRX.js +4 -0
  8. package/dist/mfa-attempts-BaKbuGvZ.js +321 -0
  9. package/dist/{mfa-attempts-BK-gWrgJ.mjs → mfa-attempts-O0x4jJzl.mjs} +6157 -6082
  10. package/dist/{passkey-enrollment-CmKahPq7.js → passkey-enrollment-CSeOQWv1.js} +1 -1
  11. package/dist/tsconfig.types.tsbuildinfo +1 -1
  12. package/dist/types/authentication-flows/mfa.d.ts +3 -1
  13. package/dist/types/authentication-flows/passwordless.d.ts +2 -2
  14. package/dist/types/emails/index.d.ts +33 -1
  15. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  16. package/dist/types/helpers/response-type-grants.d.ts +8 -0
  17. package/dist/types/hooks/custom-notification-provider.d.ts +174 -0
  18. package/dist/types/hooks/lifecycle-codehooks.d.ts +2 -2
  19. package/dist/types/index.d.ts +594 -562
  20. package/dist/types/routes/auth-api/index.d.ts +26 -26
  21. package/dist/types/routes/auth-api/passwordless.d.ts +10 -10
  22. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  23. package/dist/types/routes/auth-api/token.d.ts +10 -10
  24. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  25. package/dist/types/routes/management-api/action-triggers.d.ts +27 -27
  26. package/dist/types/routes/management-api/actions.d.ts +22 -22
  27. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  28. package/dist/types/routes/management-api/branding-uploads.d.ts +4 -4
  29. package/dist/types/routes/management-api/branding.d.ts +21 -21
  30. package/dist/types/routes/management-api/clients.d.ts +10 -10
  31. package/dist/types/routes/management-api/connections.d.ts +9 -9
  32. package/dist/types/routes/management-api/email-templates.d.ts +20 -20
  33. package/dist/types/routes/management-api/emails.d.ts +8 -8
  34. package/dist/types/routes/management-api/failed-events.d.ts +2 -2
  35. package/dist/types/routes/management-api/forms.d.ts +144 -144
  36. package/dist/types/routes/management-api/guardian.d.ts +6 -6
  37. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  38. package/dist/types/routes/management-api/hooks.d.ts +60 -60
  39. package/dist/types/routes/management-api/index.d.ts +527 -527
  40. package/dist/types/routes/management-api/jobs.d.ts +2 -2
  41. package/dist/types/routes/management-api/keys.d.ts +4 -4
  42. package/dist/types/routes/management-api/logs.d.ts +4 -4
  43. package/dist/types/routes/management-api/organizations.d.ts +2 -2
  44. package/dist/types/routes/management-api/prompts.d.ts +10 -10
  45. package/dist/types/routes/management-api/resource-servers.d.ts +8 -8
  46. package/dist/types/routes/management-api/roles.d.ts +1 -1
  47. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  48. package/dist/types/routes/management-api/self-service-profiles.d.ts +1 -1
  49. package/dist/types/routes/management-api/tenant-members.d.ts +8 -8
  50. package/dist/types/routes/management-api/tenant-operations.d.ts +4 -4
  51. package/dist/types/routes/management-api/tenants.d.ts +36 -36
  52. package/dist/types/routes/management-api/themes.d.ts +9 -9
  53. package/dist/types/routes/management-api/users.d.ts +11 -11
  54. package/dist/types/routes/universal-login/common.d.ts +10 -10
  55. package/dist/types/routes/universal-login/continue.d.ts +35 -0
  56. package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
  57. package/dist/types/routes/universal-login/form-node.d.ts +4 -4
  58. package/dist/types/routes/universal-login/index.d.ts +4 -4
  59. package/dist/types/routes/universal-login/screens/connect-authz.d.ts +13 -1
  60. package/dist/types/routes/universal-login/u2-form-node.d.ts +2 -2
  61. package/dist/types/routes/universal-login/u2-index.d.ts +36 -5
  62. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  63. package/dist/types/routes/universal-login/widget-assets.d.ts +20 -0
  64. package/dist/types/state-machines/login-session.d.ts +1 -1
  65. package/dist/types/types/AuthHeroConfig.d.ts +9 -1
  66. package/package.json +6 -6
  67. package/dist/mfa-DBhvi2B5.js +0 -1
  68. package/dist/mfa-DnCary4g.mjs +0 -128
  69. package/dist/mfa-attempts-C5kobAHS.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.