authhero 5.8.1 → 5.9.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.
Files changed (387) hide show
  1. package/dist/assets/u/widget/index.esm.js +1 -1
  2. package/dist/authhero.cjs +135 -135
  3. package/dist/authhero.d.ts +17853 -72311
  4. package/dist/authhero.mjs +16401 -16771
  5. package/dist/stats.html +1 -1
  6. package/dist/tsconfig.types.tsbuildinfo +1 -0
  7. package/dist/types/adapters/cache/in-memory.d.ts +52 -0
  8. package/dist/types/adapters/cache/index.d.ts +2 -0
  9. package/dist/types/adapters/index.d.ts +1 -0
  10. package/dist/types/authentication-flows/auth0-migration.d.ts +53 -0
  11. package/dist/types/authentication-flows/authorization-code.d.ts +23 -0
  12. package/dist/types/authentication-flows/client-credentials.d.ts +16 -0
  13. package/dist/types/authentication-flows/common.d.ts +253 -0
  14. package/dist/types/authentication-flows/connection.d.ts +17 -0
  15. package/dist/types/authentication-flows/mfa.d.ts +49 -0
  16. package/dist/types/authentication-flows/passkey-enrollment.d.ts +19 -0
  17. package/dist/types/authentication-flows/password.d.ts +24 -0
  18. package/dist/types/authentication-flows/passwordless.d.ts +571 -0
  19. package/dist/types/authentication-flows/refresh-token-migration.d.ts +17 -0
  20. package/dist/types/authentication-flows/refresh-token.d.ts +15 -0
  21. package/dist/types/authentication-flows/resume.d.ts +22 -0
  22. package/dist/types/authentication-flows/silent.d.ts +25 -0
  23. package/dist/types/authentication-flows/ticket.d.ts +7 -0
  24. package/dist/types/authentication-flows/try-connection.d.ts +33 -0
  25. package/dist/types/authentication-flows/universal.d.ts +19 -0
  26. package/dist/types/build-hash.d.ts +7 -0
  27. package/dist/types/client/client-bundle.d.ts +1 -0
  28. package/dist/types/client/form-handler.d.ts +9 -0
  29. package/dist/types/client/incognito-handler.d.ts +5 -0
  30. package/dist/types/client/index.d.ts +1 -0
  31. package/dist/types/client/input-otp.d.ts +12 -0
  32. package/dist/types/client/password-toggle.d.ts +10 -0
  33. package/dist/types/client/user-agent-detector.d.ts +22 -0
  34. package/dist/types/components/AccountChangeEmailPage.d.ts +14 -0
  35. package/dist/types/components/AccountForm.d.ts +17 -0
  36. package/dist/types/components/AccountPage.d.ts +15 -0
  37. package/dist/types/components/AppLogo.d.ts +8 -0
  38. package/dist/types/components/AuthLayout.d.ts +18 -0
  39. package/dist/types/components/Button.d.ts +12 -0
  40. package/dist/types/components/ChangeEmailForm.d.ts +14 -0
  41. package/dist/types/components/ChangeEmailPage.d.ts +15 -0
  42. package/dist/types/components/ContinueForm.d.ts +13 -0
  43. package/dist/types/components/EmailValidatedForm.d.ts +12 -0
  44. package/dist/types/components/EmailValidatedPage.d.ts +11 -0
  45. package/dist/types/components/EnterCodeForm.d.ts +13 -0
  46. package/dist/types/components/EnterCodePage.d.ts +14 -0
  47. package/dist/types/components/EnterPasswordForm.d.ts +14 -0
  48. package/dist/types/components/EnterPasswordPage.d.ts +13 -0
  49. package/dist/types/components/ErrorMessage.d.ts +6 -0
  50. package/dist/types/components/Footer.d.ts +9 -0
  51. package/dist/types/components/ForgotPasswordForm.d.ts +14 -0
  52. package/dist/types/components/ForgotPasswordPage.d.ts +13 -0
  53. package/dist/types/components/ForgotPasswordSentPage.d.ts +11 -0
  54. package/dist/types/components/Form.d.ts +6 -0
  55. package/dist/types/components/FormNodePage.d.ts +16 -0
  56. package/dist/types/components/GoBack.d.ts +5 -0
  57. package/dist/types/components/GoogleLogo.d.ts +4 -0
  58. package/dist/types/components/Icon.d.ts +8 -0
  59. package/dist/types/components/IconEye.d.ts +8 -0
  60. package/dist/types/components/IconEyeSlash.d.ts +8 -0
  61. package/dist/types/components/IconPen.d.ts +7 -0
  62. package/dist/types/components/IdentifierForm.d.ts +16 -0
  63. package/dist/types/components/IdentifierPage.d.ts +15 -0
  64. package/dist/types/components/ImpersonateForm.d.ts +14 -0
  65. package/dist/types/components/ImpersonationPage.d.ts +13 -0
  66. package/dist/types/components/InvalidSessionPage.d.ts +11 -0
  67. package/dist/types/components/Layout.d.ts +11 -0
  68. package/dist/types/components/LoginForm.d.ts +15 -0
  69. package/dist/types/components/MessagePage.d.ts +13 -0
  70. package/dist/types/components/PasswordInput.d.ts +6 -0
  71. package/dist/types/components/PreSignUpConfirmationPage.d.ts +12 -0
  72. package/dist/types/components/PreSignUpPage.d.ts +12 -0
  73. package/dist/types/components/ResetPasswordForm.d.ts +14 -0
  74. package/dist/types/components/ResetPasswordPage.d.ts +12 -0
  75. package/dist/types/components/SignUpForm.d.ts +15 -0
  76. package/dist/types/components/SignUpPage.d.ts +14 -0
  77. package/dist/types/components/SocialButton.d.ts +10 -0
  78. package/dist/types/components/Spinner.d.ts +6 -0
  79. package/dist/types/components/Trans.d.ts +8 -0
  80. package/dist/types/components/UnverifiedEmailPage.d.ts +11 -0
  81. package/dist/types/components/UserNotFoundPage.d.ts +12 -0
  82. package/dist/types/components/VippsLogo.d.ts +4 -0
  83. package/dist/types/components/index.d.ts +34 -0
  84. package/dist/types/components/stories/AccountForm.stories.d.ts +13 -0
  85. package/dist/types/components/stories/AuthLayout.stories.d.ts +27 -0
  86. package/dist/types/components/stories/ChangeEmailForm.stories.d.ts +11 -0
  87. package/dist/types/components/stories/ContinueForm.stories.d.ts +10 -0
  88. package/dist/types/components/stories/EnterCodeForm.stories.d.ts +9 -0
  89. package/dist/types/components/stories/EnterPasswordForm.stories.d.ts +22 -0
  90. package/dist/types/components/stories/IdentifierForm.stories.d.ts +42 -0
  91. package/dist/types/components/stories/IdentifierPage.stories.d.ts +33 -0
  92. package/dist/types/components/stories/ImpersonateForm.stories.d.ts +11 -0
  93. package/dist/types/components/stories/LoginForm.stories.d.ts +12 -0
  94. package/dist/types/components/ui/button.d.ts +12 -0
  95. package/dist/types/components/ui/card.d.ts +30 -0
  96. package/dist/types/components/ui/input-otp.d.ts +31 -0
  97. package/dist/types/components/ui/input.d.ts +15 -0
  98. package/dist/types/components/ui/label.d.ts +9 -0
  99. package/dist/types/constants/defaultBranding.d.ts +2 -0
  100. package/dist/types/constants/defaultTheme.d.ts +2 -0
  101. package/dist/types/constants/index.d.ts +2 -0
  102. package/dist/types/constants.d.ts +15 -0
  103. package/dist/types/email-services/index.d.ts +3 -0
  104. package/dist/types/email-services/mailgun.d.ts +18 -0
  105. package/dist/types/email-services/postmark.d.ts +14 -0
  106. package/dist/types/email-services/resend.d.ts +14 -0
  107. package/dist/types/emails/defaults/Layout.d.ts +12 -0
  108. package/dist/types/emails/defaults/PrimaryButton.d.ts +11 -0
  109. package/dist/types/emails/defaults/ResetEmail.d.ts +1 -0
  110. package/dist/types/emails/defaults/ResetEmailByCode.d.ts +1 -0
  111. package/dist/types/emails/defaults/UserInvitation.d.ts +1 -0
  112. package/dist/types/emails/defaults/VerifyEmail.d.ts +1 -0
  113. package/dist/types/emails/defaults/VerifyEmailByCode.d.ts +1 -0
  114. package/dist/types/emails/defaults/WelcomeEmail.d.ts +1 -0
  115. package/dist/types/emails/defaults/compiled.d.ts +2 -0
  116. package/dist/types/emails/defaults/index.d.ts +6 -0
  117. package/dist/types/emails/defaults/subjects.d.ts +2 -0
  118. package/dist/types/emails/index.d.ts +70 -0
  119. package/dist/types/emails/render.d.ts +41 -0
  120. package/dist/types/errors/is-unique-constraint-error.d.ts +8 -0
  121. package/dist/types/errors/json-http-exception.d.ts +5 -0
  122. package/dist/types/errors/redirect-exception.d.ts +6 -0
  123. package/dist/types/generated/locale-types.d.ts +690 -0
  124. package/dist/types/helpers/cache-wrapper.d.ts +23 -0
  125. package/dist/types/helpers/client-assertion.d.ts +49 -0
  126. package/dist/types/helpers/client-keys.d.ts +27 -0
  127. package/dist/types/helpers/client.d.ts +496 -0
  128. package/dist/types/helpers/dcr/constraint-enforcement.d.ts +24 -0
  129. package/dist/types/helpers/dcr/metadata-mapping.d.ts +83 -0
  130. package/dist/types/helpers/dcr/mint-iat.d.ts +14 -0
  131. package/dist/types/helpers/dcr/mint-token.d.ts +7 -0
  132. package/dist/types/helpers/dcr/validate-connect-origin.d.ts +20 -0
  133. package/dist/types/helpers/dcr/verify-token.d.ts +8 -0
  134. package/dist/types/helpers/default-destinations.d.ts +55 -0
  135. package/dist/types/helpers/entity-hooks-wrapper.d.ts +43 -0
  136. package/dist/types/helpers/hook-events.d.ts +20 -0
  137. package/dist/types/helpers/hook-user-payload.d.ts +8 -0
  138. package/dist/types/helpers/hrd.d.ts +3 -0
  139. package/dist/types/helpers/logging.d.ts +65 -0
  140. package/dist/types/helpers/outbox-cleanup.d.ts +10 -0
  141. package/dist/types/helpers/outbox-destinations/index.d.ts +2 -0
  142. package/dist/types/helpers/outbox-destinations/log-streams.d.ts +66 -0
  143. package/dist/types/helpers/outbox-destinations/logs.d.ts +20 -0
  144. package/dist/types/helpers/outbox-destinations/registration-finalizer.d.ts +29 -0
  145. package/dist/types/helpers/outbox-destinations/webhooks.d.ts +57 -0
  146. package/dist/types/helpers/outbox-relay.d.ts +34 -0
  147. package/dist/types/helpers/password-policy.d.ts +54 -0
  148. package/dist/types/helpers/request-object.d.ts +40 -0
  149. package/dist/types/helpers/run-outbox-relay.d.ts +58 -0
  150. package/dist/types/helpers/saml.d.ts +1 -0
  151. package/dist/types/helpers/scope-claims.d.ts +4 -0
  152. package/dist/types/helpers/scopes-permissions.d.ts +38 -0
  153. package/dist/types/helpers/server-timing.d.ts +12 -0
  154. package/dist/types/helpers/service-token.d.ts +54 -0
  155. package/dist/types/helpers/set-tenant-id.d.ts +15 -0
  156. package/dist/types/helpers/signing-keys.d.ts +16 -0
  157. package/dist/types/helpers/try-connection-client.d.ts +15 -0
  158. package/dist/types/helpers/user-linking.d.ts +14 -0
  159. package/dist/types/helpers/user-session-cleanup.d.ts +21 -0
  160. package/dist/types/helpers/users.d.ts +46 -0
  161. package/dist/types/helpers/wait-until.d.ts +21 -0
  162. package/dist/types/hooks/addDataHooks.d.ts +16 -0
  163. package/dist/types/hooks/code-executor/local.d.ts +13 -0
  164. package/dist/types/hooks/codehooks.d.ts +70 -0
  165. package/dist/types/hooks/formhooks.d.ts +99 -0
  166. package/dist/types/hooks/helpers/token-api.d.ts +17 -0
  167. package/dist/types/hooks/index.d.ts +20 -0
  168. package/dist/types/hooks/link-users.d.ts +29 -0
  169. package/dist/types/hooks/pagehooks.d.ts +16 -0
  170. package/dist/types/hooks/post-user-login.d.ts +29 -0
  171. package/dist/types/hooks/pre-defined/account-linking.d.ts +73 -0
  172. package/dist/types/hooks/pre-defined/ensure-username.d.ts +86 -0
  173. package/dist/types/hooks/pre-defined/index.d.ts +23 -0
  174. package/dist/types/hooks/pre-defined/set-preferred-username.d.ts +26 -0
  175. package/dist/types/hooks/templatehooks.d.ts +29 -0
  176. package/dist/types/hooks/user-deletion.d.ts +14 -0
  177. package/dist/types/hooks/user-registration.d.ts +88 -0
  178. package/dist/types/hooks/user-update.d.ts +16 -0
  179. package/dist/types/hooks/validate-signup.d.ts +34 -0
  180. package/dist/types/hooks/webhooks.d.ts +35 -0
  181. package/dist/types/i18n/index.d.ts +77 -0
  182. package/dist/types/index.d.ts +16022 -0
  183. package/dist/types/locales/index.d.ts +9 -0
  184. package/dist/types/middlewares/apply-config.d.ts +14 -0
  185. package/dist/types/middlewares/authentication.d.ts +26 -0
  186. package/dist/types/middlewares/client-info.d.ts +8 -0
  187. package/dist/types/middlewares/index.d.ts +6 -0
  188. package/dist/types/middlewares/outbox.d.ts +24 -0
  189. package/dist/types/middlewares/register-component.d.ts +10 -0
  190. package/dist/types/middlewares/tenant.d.ts +12 -0
  191. package/dist/types/migration-providers/auth0.d.ts +3 -0
  192. package/dist/types/migration-providers/index.d.ts +5 -0
  193. package/dist/types/migration-providers/types.d.ts +32 -0
  194. package/dist/types/routes/auth-api/account.d.ts +36 -0
  195. package/dist/types/routes/auth-api/authenticate.d.ts +31 -0
  196. package/dist/types/routes/auth-api/authorize.d.ts +239 -0
  197. package/dist/types/routes/auth-api/callback.d.ts +234 -0
  198. package/dist/types/routes/auth-api/connect-start.d.ts +52 -0
  199. package/dist/types/routes/auth-api/dbconnections.d.ts +43 -0
  200. package/dist/types/routes/auth-api/index.d.ts +1580 -0
  201. package/dist/types/routes/auth-api/logout.d.ts +20 -0
  202. package/dist/types/routes/auth-api/oidc-logout.d.ts +52 -0
  203. package/dist/types/routes/auth-api/passwordless.d.ts +154 -0
  204. package/dist/types/routes/auth-api/register/index.d.ts +159 -0
  205. package/dist/types/routes/auth-api/register/shared.d.ts +30 -0
  206. package/dist/types/routes/auth-api/revoke.d.ts +73 -0
  207. package/dist/types/routes/auth-api/token.d.ts +412 -0
  208. package/dist/types/routes/auth-api/userinfo.d.ts +84 -0
  209. package/dist/types/routes/auth-api/well-known.d.ts +74 -0
  210. package/dist/types/routes/management-api/action-executions.d.ts +90 -0
  211. package/dist/types/routes/management-api/action-triggers.d.ts +118 -0
  212. package/dist/types/routes/management-api/actions.d.ts +673 -0
  213. package/dist/types/routes/management-api/analytics.d.ts +18 -0
  214. package/dist/types/routes/management-api/attack-protection.d.ts +189 -0
  215. package/dist/types/routes/management-api/authentication-methods.d.ts +115 -0
  216. package/dist/types/routes/management-api/branding.d.ts +402 -0
  217. package/dist/types/routes/management-api/client-grants.d.ts +183 -0
  218. package/dist/types/routes/management-api/client-registration-tokens.d.ts +35 -0
  219. package/dist/types/routes/management-api/clients.d.ts +995 -0
  220. package/dist/types/routes/management-api/connections.d.ts +872 -0
  221. package/dist/types/routes/management-api/custom-domains.d.ts +266 -0
  222. package/dist/types/routes/management-api/email-templates.d.ts +205 -0
  223. package/dist/types/routes/management-api/emails.d.ts +124 -0
  224. package/dist/types/routes/management-api/failed-events.d.ts +146 -0
  225. package/dist/types/routes/management-api/flows.d.ts +438 -0
  226. package/dist/types/routes/management-api/forms.d.ts +4090 -0
  227. package/dist/types/routes/management-api/guardian.d.ts +211 -0
  228. package/dist/types/routes/management-api/hook-code.d.ts +142 -0
  229. package/dist/types/routes/management-api/hooks.d.ts +405 -0
  230. package/dist/types/routes/management-api/index.d.ts +13277 -0
  231. package/dist/types/routes/management-api/keys.d.ts +98 -0
  232. package/dist/types/routes/management-api/log-streams.d.ts +170 -0
  233. package/dist/types/routes/management-api/logs.d.ts +159 -0
  234. package/dist/types/routes/management-api/migration-sources.d.ts +173 -0
  235. package/dist/types/routes/management-api/organizations.d.ts +896 -0
  236. package/dist/types/routes/management-api/prompts.d.ts +150 -0
  237. package/dist/types/routes/management-api/refresh_tokens.d.ts +66 -0
  238. package/dist/types/routes/management-api/resource-servers.d.ts +321 -0
  239. package/dist/types/routes/management-api/roles.d.ts +260 -0
  240. package/dist/types/routes/management-api/sessions.d.ts +78 -0
  241. package/dist/types/routes/management-api/stats.d.ts +44 -0
  242. package/dist/types/routes/management-api/tenants.d.ts +546 -0
  243. package/dist/types/routes/management-api/themes.d.ts +265 -0
  244. package/dist/types/routes/management-api/tickets.d.ts +75 -0
  245. package/dist/types/routes/management-api/users-by-email.d.ts +90 -0
  246. package/dist/types/routes/management-api/users.d.ts +1085 -0
  247. package/dist/types/routes/saml/index.d.ts +64 -0
  248. package/dist/types/routes/saml/samlp.d.ts +64 -0
  249. package/dist/types/routes/setup.d.ts +6 -0
  250. package/dist/types/routes/universal-login/account-change-email-confirmation.d.ts +30 -0
  251. package/dist/types/routes/universal-login/account-change-email-verify.d.ts +66 -0
  252. package/dist/types/routes/universal-login/account-change-email.d.ts +58 -0
  253. package/dist/types/routes/universal-login/account.d.ts +64 -0
  254. package/dist/types/routes/universal-login/common.d.ts +1482 -0
  255. package/dist/types/routes/universal-login/continue.d.ts +37 -0
  256. package/dist/types/routes/universal-login/enter-password.d.ts +49 -0
  257. package/dist/types/routes/universal-login/error-handler.d.ts +14 -0
  258. package/dist/types/routes/universal-login/error-page.d.ts +32 -0
  259. package/dist/types/routes/universal-login/error.d.ts +20 -0
  260. package/dist/types/routes/universal-login/flow-api.d.ts +381 -0
  261. package/dist/types/routes/universal-login/flow-widget.d.ts +23 -0
  262. package/dist/types/routes/universal-login/forgot-password.d.ts +32 -0
  263. package/dist/types/routes/universal-login/form-node.d.ts +74 -0
  264. package/dist/types/routes/universal-login/identifier.d.ts +55 -0
  265. package/dist/types/routes/universal-login/impersonate.d.ts +71 -0
  266. package/dist/types/routes/universal-login/index.d.ts +748 -0
  267. package/dist/types/routes/universal-login/info.d.ts +20 -0
  268. package/dist/types/routes/universal-login/invalid-session.d.ts +19 -0
  269. package/dist/types/routes/universal-login/otp-challenge.d.ts +54 -0
  270. package/dist/types/routes/universal-login/pre-signup-sent.d.ts +19 -0
  271. package/dist/types/routes/universal-login/pre-signup.d.ts +32 -0
  272. package/dist/types/routes/universal-login/reset-password.d.ts +39 -0
  273. package/dist/types/routes/universal-login/sanitization-utils.d.ts +55 -0
  274. package/dist/types/routes/universal-login/screen-api.d.ts +20 -0
  275. package/dist/types/routes/universal-login/screens/accept-invitation.d.ts +13 -0
  276. package/dist/types/routes/universal-login/screens/account-delete.d.ts +14 -0
  277. package/dist/types/routes/universal-login/screens/account-helpers.d.ts +13 -0
  278. package/dist/types/routes/universal-login/screens/account-linked.d.ts +14 -0
  279. package/dist/types/routes/universal-login/screens/account-mfa-phone-enrollment.d.ts +10 -0
  280. package/dist/types/routes/universal-login/screens/account-mfa-totp-enrollment.d.ts +10 -0
  281. package/dist/types/routes/universal-login/screens/account-passkeys.d.ts +10 -0
  282. package/dist/types/routes/universal-login/screens/account-profile.d.ts +14 -0
  283. package/dist/types/routes/universal-login/screens/account-security.d.ts +14 -0
  284. package/dist/types/routes/universal-login/screens/account.d.ts +14 -0
  285. package/dist/types/routes/universal-login/screens/connect-consent.d.ts +9 -0
  286. package/dist/types/routes/universal-login/screens/connect-tenant-select.d.ts +13 -0
  287. package/dist/types/routes/universal-login/screens/email-otp-challenge.d.ts +14 -0
  288. package/dist/types/routes/universal-login/screens/enter-password.d.ts +14 -0
  289. package/dist/types/routes/universal-login/screens/forgot-password.d.ts +11 -0
  290. package/dist/types/routes/universal-login/screens/identifier.d.ts +14 -0
  291. package/dist/types/routes/universal-login/screens/impersonate.d.ts +15 -0
  292. package/dist/types/routes/universal-login/screens/index.d.ts +29 -0
  293. package/dist/types/routes/universal-login/screens/login-passwordless-identifier.d.ts +17 -0
  294. package/dist/types/routes/universal-login/screens/login.d.ts +17 -0
  295. package/dist/types/routes/universal-login/screens/magic-link-sent.d.ts +11 -0
  296. package/dist/types/routes/universal-login/screens/mfa-login-options.d.ts +21 -0
  297. package/dist/types/routes/universal-login/screens/mfa-phone-challenge.d.ts +14 -0
  298. package/dist/types/routes/universal-login/screens/mfa-phone-enrollment.d.ts +14 -0
  299. package/dist/types/routes/universal-login/screens/mfa-totp-challenge.d.ts +14 -0
  300. package/dist/types/routes/universal-login/screens/mfa-totp-enrollment.d.ts +17 -0
  301. package/dist/types/routes/universal-login/screens/passkey-challenge.d.ts +16 -0
  302. package/dist/types/routes/universal-login/screens/passkey-enrollment-nudge.d.ts +17 -0
  303. package/dist/types/routes/universal-login/screens/passkey-enrollment.d.ts +11 -0
  304. package/dist/types/routes/universal-login/screens/passkey-utils.d.ts +100 -0
  305. package/dist/types/routes/universal-login/screens/registry.d.ts +28 -0
  306. package/dist/types/routes/universal-login/screens/reset-password-code.d.ts +18 -0
  307. package/dist/types/routes/universal-login/screens/reset-password.d.ts +36 -0
  308. package/dist/types/routes/universal-login/screens/signup.d.ts +14 -0
  309. package/dist/types/routes/universal-login/screens/sms-otp-challenge.d.ts +14 -0
  310. package/dist/types/routes/universal-login/screens/try-connection-result.d.ts +12 -0
  311. package/dist/types/routes/universal-login/screens/types.d.ts +167 -0
  312. package/dist/types/routes/universal-login/signup.d.ts +54 -0
  313. package/dist/types/routes/universal-login/u2-form-node.d.ts +93 -0
  314. package/dist/types/routes/universal-login/u2-index.d.ts +337 -0
  315. package/dist/types/routes/universal-login/u2-routes.d.ts +262 -0
  316. package/dist/types/routes/universal-login/u2-widget-page.d.ts +187 -0
  317. package/dist/types/routes/universal-login/universal-login-template.d.ts +55 -0
  318. package/dist/types/routes/universal-login/validate-email.d.ts +20 -0
  319. package/dist/types/routes/universal-login/widget-routes.d.ts +81 -0
  320. package/dist/types/seed.d.ts +86 -0
  321. package/dist/types/state-machines/index.d.ts +1 -0
  322. package/dist/types/state-machines/login-session.d.ts +173 -0
  323. package/dist/types/storybook-utils/HonoJSXWrapper.d.ts +43 -0
  324. package/dist/types/strategies/apple.d.ts +24 -0
  325. package/dist/types/strategies/facebook.d.ts +20 -0
  326. package/dist/types/strategies/github.d.ts +23 -0
  327. package/dist/types/strategies/google-oauth2.d.ts +43 -0
  328. package/dist/types/strategies/index.d.ts +69 -0
  329. package/dist/types/strategies/internal-oauth2.d.ts +17 -0
  330. package/dist/types/strategies/microsoft.d.ts +24 -0
  331. package/dist/types/strategies/oauth2.d.ts +38 -0
  332. package/dist/types/strategies/oidc.d.ts +38 -0
  333. package/dist/types/strategies/saml.d.ts +9 -0
  334. package/dist/types/strategies/vipps.d.ts +16 -0
  335. package/dist/types/styles/index.d.ts +9 -0
  336. package/dist/types/styles/tailwind.d.ts +1 -0
  337. package/dist/types/types/Auth0Client.d.ts +9 -0
  338. package/dist/types/types/AuthError.d.ts +14 -0
  339. package/dist/types/types/AuthHeroConfig.d.ts +415 -0
  340. package/dist/types/types/Bindings.d.ts +51 -0
  341. package/dist/types/types/GrantFlowResult.d.ts +22 -0
  342. package/dist/types/types/Hooks.d.ts +240 -0
  343. package/dist/types/types/IdToken.d.ts +30 -0
  344. package/dist/types/types/UserInfo.d.ts +8 -0
  345. package/dist/types/types/Variables.d.ts +33 -0
  346. package/dist/types/types/auth0/Query.d.ts +12 -0
  347. package/dist/types/types/auth0/Totals.d.ts +11 -0
  348. package/dist/types/types/auth0/UserResponse.d.ts +46 -0
  349. package/dist/types/types/auth0/index.d.ts +3 -0
  350. package/dist/types/types/index.d.ts +6 -0
  351. package/dist/types/types/saml.d.ts +1 -0
  352. package/dist/types/utils/append-log.d.ts +10 -0
  353. package/dist/types/utils/auth-header.d.ts +18 -0
  354. package/dist/types/utils/auth0-upstream.d.ts +60 -0
  355. package/dist/types/utils/authIframe.d.ts +11 -0
  356. package/dist/types/utils/client-info.d.ts +47 -0
  357. package/dist/types/utils/color.d.ts +23 -0
  358. package/dist/types/utils/connections.d.ts +11 -0
  359. package/dist/types/utils/cookies.d.ts +28 -0
  360. package/dist/types/utils/crypto.d.ts +2 -0
  361. package/dist/types/utils/deep-merge.d.ts +6 -0
  362. package/dist/types/utils/define-route.d.ts +20 -0
  363. package/dist/types/utils/encryption.d.ts +22 -0
  364. package/dist/types/utils/entity-id.d.ts +13 -0
  365. package/dist/types/utils/fetchAll.d.ts +60 -0
  366. package/dist/types/utils/form-post.d.ts +1 -0
  367. package/dist/types/utils/id-token-hash.d.ts +1 -0
  368. package/dist/types/utils/incognito.d.ts +11 -0
  369. package/dist/types/utils/instance-to-json.d.ts +8 -0
  370. package/dist/types/utils/ip.d.ts +8 -0
  371. package/dist/types/utils/is-valid-redirect-url.d.ts +4 -0
  372. package/dist/types/utils/jwk-alg.d.ts +20 -0
  373. package/dist/types/utils/jwks.d.ts +41 -0
  374. package/dist/types/utils/jwt.d.ts +15 -0
  375. package/dist/types/utils/organization-id.d.ts +2 -0
  376. package/dist/types/utils/otp.d.ts +1 -0
  377. package/dist/types/utils/refresh-token-format.d.ts +20 -0
  378. package/dist/types/utils/safe-compare.d.ts +1 -0
  379. package/dist/types/utils/sort.d.ts +4 -0
  380. package/dist/types/utils/ssrf-fetch.d.ts +44 -0
  381. package/dist/types/utils/ulid.d.ts +1 -0
  382. package/dist/types/utils/url.d.ts +16 -0
  383. package/dist/types/utils/user-id.d.ts +2 -0
  384. package/dist/types/utils/username-password-provider.d.ts +67 -0
  385. package/dist/types/utils/username.d.ts +11 -0
  386. package/dist/types/variables.d.ts +4 -0
  387. package/package.json +11 -11
@@ -0,0 +1,52 @@
1
+ import { CacheAdapter } from "@authhero/adapter-interfaces";
2
+ export interface InMemoryCacheConfig {
3
+ /**
4
+ * Default TTL in seconds for cache entries (optional)
5
+ */
6
+ defaultTtlSeconds?: number;
7
+ /**
8
+ * Maximum number of entries in the cache (optional, for basic LRU behavior)
9
+ */
10
+ maxEntries?: number;
11
+ /**
12
+ * Interval in milliseconds for cleanup of expired entries (default: 60000ms = 1 minute)
13
+ */
14
+ cleanupIntervalMs?: number;
15
+ }
16
+ export declare class InMemoryCache implements CacheAdapter {
17
+ private config;
18
+ private cache;
19
+ private accessOrder;
20
+ private accessCounter;
21
+ private cleanupTimer?;
22
+ constructor(config?: InMemoryCacheConfig);
23
+ get<T = any>(key: string): Promise<T | null>;
24
+ set<T = any>(key: string, value: T, ttlSeconds?: number): Promise<void>;
25
+ delete(key: string): Promise<boolean>;
26
+ deleteByPrefix(prefix: string): Promise<number>;
27
+ clear(): Promise<void>;
28
+ /**
29
+ * Get cache statistics
30
+ */
31
+ getStats(): {
32
+ size: number;
33
+ maxEntries: number | undefined;
34
+ defaultTtlSeconds: number | undefined;
35
+ };
36
+ /**
37
+ * Clean up expired entries
38
+ */
39
+ private cleanupExpired;
40
+ /**
41
+ * Evict least recently used entry
42
+ */
43
+ private evictLeastRecentlyUsed;
44
+ /**
45
+ * Stop cleanup timer (useful for testing or graceful shutdown)
46
+ */
47
+ destroy(): void;
48
+ }
49
+ /**
50
+ * Create an in-memory cache adapter
51
+ */
52
+ export declare function createInMemoryCache(config?: InMemoryCacheConfig): CacheAdapter;
@@ -0,0 +1,2 @@
1
+ export { createInMemoryCache } from "./in-memory";
2
+ export type { InMemoryCacheConfig } from "./in-memory";
@@ -0,0 +1 @@
1
+ export * from "./cache";
@@ -0,0 +1,53 @@
1
+ import { Context } from "hono";
2
+ import { Connection, User } from "@authhero/adapter-interfaces";
3
+ import { Bindings, Variables } from "../types";
4
+ import { EnrichedClient } from "../helpers/client";
5
+ interface Auth0SourceCredentials {
6
+ tokenEndpoint: string;
7
+ userinfoEndpoint: string;
8
+ clientId: string;
9
+ clientSecret: string;
10
+ realm?: string;
11
+ }
12
+ /**
13
+ * Read the upstream migration credentials from a DB connection's
14
+ * `options.configuration` (Auth0-shape: the destination connection holds the
15
+ * upstream creds inline). Returns null if any required field is missing —
16
+ * callers should treat this as "migration is not configured" and fall through
17
+ * to the normal failure path.
18
+ */
19
+ export declare function readAuth0SourceCredentials(dbConnection: Connection): Auth0SourceCredentials | null;
20
+ interface AttemptUpstreamPasswordParams {
21
+ ctx: Context<{
22
+ Bindings: Bindings;
23
+ Variables: Variables;
24
+ }>;
25
+ client: EnrichedClient;
26
+ username: string;
27
+ password: string;
28
+ /**
29
+ * The local DB connection the login is targeting. Its `name` is sent as
30
+ * `realm` to upstream Auth0 (unless `options.configuration.realm` overrides
31
+ * it), and its `options.configuration` carries the upstream credentials.
32
+ * Must have `options.import_mode: true` to be eligible.
33
+ */
34
+ dbConnection: Connection;
35
+ /**
36
+ * The local user, if one already exists. When null, a new user record is
37
+ * created from the `/userinfo` profile on upstream success.
38
+ */
39
+ existingUser: User | null;
40
+ }
41
+ /**
42
+ * Attempts to verify the supplied password against the upstream Auth0 tenant
43
+ * via the password-realm grant. On success, creates the local user (if
44
+ * missing), stores the bcrypt hash of the password locally, and returns the
45
+ * user. On any failure, returns null — the caller surfaces the existing
46
+ * INVALID_PASSWORD/USER_NOT_FOUND error so the upstream's existence is not
47
+ * leaked to clients.
48
+ *
49
+ * Subsequent logins are served entirely locally because the password row now
50
+ * exists on our side.
51
+ */
52
+ export declare function attemptUpstreamPasswordFallback(params: AttemptUpstreamPasswordParams): Promise<User | null>;
53
+ export {};
@@ -0,0 +1,23 @@
1
+ import { Context } from "hono";
2
+ import { z } from "@hono/zod-openapi";
3
+ import { Bindings, Variables } from "../types";
4
+ import { TokenResponse } from "@authhero/adapter-interfaces";
5
+ import { GrantFlowUserResult } from "src/types/GrantFlowResult";
6
+ export declare const authorizationCodeGrantParamsSchema: z.ZodObject<{
7
+ grant_type: z.ZodLiteral<"authorization_code">;
8
+ client_id: z.ZodString;
9
+ code: z.ZodString;
10
+ redirect_uri: z.ZodOptional<z.ZodString>;
11
+ client_secret: z.ZodOptional<z.ZodString>;
12
+ code_verifier: z.ZodOptional<z.ZodString>;
13
+ organization: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ export type AuthorizationCodeGrantTypeParams = z.infer<typeof authorizationCodeGrantParamsSchema>;
16
+ export declare function authorizationCodeGrantUser(ctx: Context<{
17
+ Bindings: Bindings;
18
+ Variables: Variables;
19
+ }>, params: AuthorizationCodeGrantTypeParams): Promise<GrantFlowUserResult>;
20
+ export declare function authorizationCodeGrant(ctx: Context<{
21
+ Bindings: Bindings;
22
+ Variables: Variables;
23
+ }>, params: AuthorizationCodeGrantTypeParams): Promise<TokenResponse | Response>;
@@ -0,0 +1,16 @@
1
+ import { Context } from "hono";
2
+ import { z } from "@hono/zod-openapi";
3
+ import { Bindings, Variables } from "../types";
4
+ import { GrantFlowResult } from "../types/GrantFlowResult";
5
+ export declare const clientCredentialGrantParamsSchema: z.ZodObject<{
6
+ grant_type: z.ZodLiteral<"client_credentials">;
7
+ scope: z.ZodOptional<z.ZodString>;
8
+ client_secret: z.ZodOptional<z.ZodString>;
9
+ client_id: z.ZodString;
10
+ audience: z.ZodOptional<z.ZodString>;
11
+ organization: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ export declare function clientCredentialsGrant(ctx: Context<{
14
+ Bindings: Bindings;
15
+ Variables: Variables;
16
+ }>, params: z.infer<typeof clientCredentialGrantParamsSchema>): Promise<GrantFlowResult>;
@@ -0,0 +1,253 @@
1
+ import { AuthorizationResponseType, AuthParams, LoginSession, RefreshToken, User, TokenResponse } from "@authhero/adapter-interfaces";
2
+ import { EnrichedClient } from "../helpers/client";
3
+ import { Context } from "hono";
4
+ import { Bindings, Variables } from "../types";
5
+ import { GrantType } from "@authhero/adapter-interfaces";
6
+ /**
7
+ * Minimal client properties actually used by createAuthTokens.
8
+ * This avoids requiring a full EnrichedClient when only a few fields are needed
9
+ * (e.g. service tokens).
10
+ */
11
+ export interface AuthTokenClient {
12
+ client_id: string;
13
+ tenant: {
14
+ audience: string;
15
+ default_audience?: string;
16
+ allow_organization_name_in_authentication_api?: boolean;
17
+ };
18
+ auth0_conformant?: boolean;
19
+ }
20
+ export interface CreateAuthTokensParams {
21
+ authParams: AuthParams;
22
+ client: AuthTokenClient;
23
+ loginSession?: LoginSession;
24
+ user?: User;
25
+ session_id?: string;
26
+ refresh_token?: string;
27
+ authStrategy?: {
28
+ strategy: string;
29
+ strategy_type: string;
30
+ };
31
+ /** The connection name used for authentication (e.g., "email", "google-oauth2") */
32
+ authConnection?: string;
33
+ ticketAuth?: boolean;
34
+ skipHooks?: boolean;
35
+ organization?: {
36
+ id: string;
37
+ name: string;
38
+ };
39
+ permissions?: string[];
40
+ grantType?: GrantType;
41
+ impersonatingUser?: User;
42
+ auth_time?: number;
43
+ /** Custom claims to add to the access token payload (cannot override reserved claims) */
44
+ customClaims?: Record<string, unknown>;
45
+ /** Access token lifetime in seconds, from resource server config */
46
+ token_lifetime?: number;
47
+ /**
48
+ * Authorization code co-issued in the same front-channel response (hybrid
49
+ * flow). When provided AND an id_token is being issued, a `c_hash` claim
50
+ * covering this code is added to the id_token per OIDC Core 3.3.2.11.
51
+ */
52
+ code?: string;
53
+ }
54
+ export declare function createAuthTokens(ctx: Context<{
55
+ Bindings: Bindings;
56
+ Variables: Variables;
57
+ }>, params: CreateAuthTokensParams): Promise<TokenResponse>;
58
+ export interface CreateCodeParams {
59
+ user: User;
60
+ client: EnrichedClient;
61
+ authParams: AuthParams;
62
+ login_id: string;
63
+ }
64
+ export declare function createCodeData(ctx: Context<{
65
+ Bindings: Bindings;
66
+ Variables: Variables;
67
+ }>, params: CreateCodeParams): Promise<{
68
+ code: string;
69
+ state: string | undefined;
70
+ }>;
71
+ export interface CreateRefreshTokenParams {
72
+ user: User;
73
+ client: EnrichedClient;
74
+ login_id: string;
75
+ scope: string;
76
+ audience?: string;
77
+ }
78
+ export interface CreatedRefreshToken {
79
+ row: RefreshToken;
80
+ wireToken: string;
81
+ }
82
+ export declare function createRefreshToken(ctx: Context<{
83
+ Bindings: Bindings;
84
+ Variables: Variables;
85
+ }>, params: CreateRefreshTokenParams): Promise<CreatedRefreshToken>;
86
+ export interface CreateSessionParams {
87
+ user: User;
88
+ client: EnrichedClient;
89
+ loginSession: LoginSession;
90
+ }
91
+ export interface AuthenticateLoginSessionParams {
92
+ user: User;
93
+ client: EnrichedClient;
94
+ loginSession: LoginSession;
95
+ /** Optional existing session to reuse instead of creating a new one */
96
+ existingSessionId?: string;
97
+ /** The connection name used for authentication (e.g., "email", "google-oauth2") */
98
+ authConnection?: string;
99
+ }
100
+ /**
101
+ * Authenticate a login session - transitions from PENDING to AUTHENTICATED
102
+ *
103
+ * This is the single source of truth for authentication state transitions.
104
+ * It either creates a new session or links an existing one, and always
105
+ * transitions the state to AUTHENTICATED.
106
+ *
107
+ * Uses optimistic concurrency: re-fetches current state to prevent stale overwrites
108
+ * and guards against terminal states (FAILED, EXPIRED, COMPLETED)
109
+ *
110
+ * @returns The session ID (either newly created or existing)
111
+ */
112
+ export declare function authenticateLoginSession(ctx: Context<{
113
+ Bindings: Bindings;
114
+ Variables: Variables;
115
+ }>, { user, client, loginSession, existingSessionId, authConnection, }: AuthenticateLoginSessionParams): Promise<string>;
116
+ export interface FinalizeAuthenticatedSessionParams extends AuthenticateLoginSessionParams {
117
+ /** Strategy metadata persisted so /authorize/resume can rehydrate it */
118
+ authStrategy?: {
119
+ strategy: string;
120
+ strategy_type: string;
121
+ };
122
+ }
123
+ /**
124
+ * Persist an authenticated identity onto the login session and 302 the browser
125
+ * to `/authorize/resume?state=…`. This is the terminal step for sub-flows
126
+ * (social callback, UL password/OTP/signup, SAML SP-ACS, etc.) — instead of
127
+ * issuing tokens and setting the session cookie inline, they persist enough
128
+ * state for the resume endpoint to do it on the correct domain.
129
+ *
130
+ * Mirrors Auth0's pattern where /u/login/{password,…} 302s to /authorize/resume.
131
+ */
132
+ export declare function finalizeAuthenticatedSession(ctx: Context<{
133
+ Bindings: Bindings;
134
+ Variables: Variables;
135
+ }>, params: FinalizeAuthenticatedSessionParams): Promise<Response>;
136
+ /**
137
+ * @deprecated Use authenticateLoginSession instead.
138
+ * This function is kept for backward compatibility but will be removed.
139
+ */
140
+ export declare function createSession(ctx: Context<{
141
+ Bindings: Bindings;
142
+ Variables: Variables;
143
+ }>, { user, client, loginSession }: CreateSessionParams): Promise<{
144
+ id: string;
145
+ }>;
146
+ /**
147
+ * Mark a login session as failed
148
+ * This should be called when authentication fails (wrong password, blocked user, etc.)
149
+ *
150
+ * Uses optimistic concurrency: re-fetches current state to prevent stale overwrites
151
+ */
152
+ export declare function failLoginSession(ctx: Context<{
153
+ Bindings: Bindings;
154
+ Variables: Variables;
155
+ }>, tenantId: string, loginSession: LoginSession, reason: string): Promise<void>;
156
+ /**
157
+ * Mark a login session as awaiting hook completion
158
+ * This should be called when redirecting to a form, page, or external URL
159
+ *
160
+ * Uses optimistic concurrency: re-fetches current state to prevent stale overwrites
161
+ */
162
+ export declare function startLoginSessionHook(ctx: Context<{
163
+ Bindings: Bindings;
164
+ Variables: Variables;
165
+ }>, tenantId: string, loginSession: LoginSession, hookId?: string): Promise<void>;
166
+ /**
167
+ * Mark a login session as returning from a hook
168
+ * This should be called when the user returns via /u/continue after a form/page redirect
169
+ *
170
+ * Uses optimistic concurrency: re-fetches current state to prevent stale overwrites
171
+ */
172
+ export declare function completeLoginSessionHook(ctx: Context<{
173
+ Bindings: Bindings;
174
+ Variables: Variables;
175
+ }>, tenantId: string, loginSession: LoginSession): Promise<void>;
176
+ /**
177
+ * Mark a login session as completed (tokens issued)
178
+ * This should be called when tokens are successfully returned to the client
179
+ *
180
+ * Uses optimistic concurrency: re-fetches current state to prevent stale overwrites
181
+ */
182
+ export declare function completeLoginSession(ctx: Context<{
183
+ Bindings: Bindings;
184
+ Variables: Variables;
185
+ }>, tenantId: string, loginSession: LoginSession, auth_connection?: string): Promise<void>;
186
+ /**
187
+ * Start a continuation - user is redirected to an account page (change-email, etc.)
188
+ * This transitions to AWAITING_CONTINUATION and stores the allowed scope and return URL
189
+ *
190
+ * Uses optimistic concurrency: re-fetches current state to prevent stale overwrites
191
+ */
192
+ export declare function startLoginSessionContinuation(ctx: Context<{
193
+ Bindings: Bindings;
194
+ Variables: Variables;
195
+ }>, tenantId: string, loginSession: LoginSession, scope: string[], returnUrl: string): Promise<void>;
196
+ /**
197
+ * Complete a continuation - user finished the account page action
198
+ * This transitions back to AUTHENTICATED so the login flow can continue
199
+ *
200
+ * Uses optimistic concurrency: re-fetches current state to prevent stale overwrites
201
+ */
202
+ export declare function completeLoginSessionContinuation(ctx: Context<{
203
+ Bindings: Bindings;
204
+ Variables: Variables;
205
+ }>, tenantId: string, loginSession: LoginSession): Promise<string | undefined>;
206
+ /**
207
+ * Check if a login session allows access to a given scope during continuation
208
+ */
209
+ export declare function hasValidContinuationScope(loginSession: LoginSession, requiredScope: string): boolean;
210
+ export interface CreateAuthResponseParams {
211
+ authParams: AuthParams;
212
+ client: EnrichedClient;
213
+ user: User;
214
+ loginSession?: LoginSession;
215
+ /**
216
+ * An existing session ID to link to the login session instead of creating a new one.
217
+ * Use this when the user already has a valid session (e.g., from a cookie) that should be reused.
218
+ *
219
+ * If not provided and loginSession is in PENDING state, a new session will be created.
220
+ * If provided, this session will be linked and the state will transition to AUTHENTICATED.
221
+ */
222
+ existingSessionIdToLink?: string;
223
+ refreshToken?: string;
224
+ ticketAuth?: boolean;
225
+ authStrategy?: {
226
+ strategy: string;
227
+ strategy_type: string;
228
+ };
229
+ /** The connection name used for authentication (e.g., "email", "google-oauth2") */
230
+ authConnection?: string;
231
+ skipHooks?: boolean;
232
+ organization?: {
233
+ id: string;
234
+ name: string;
235
+ };
236
+ impersonatingUser?: User;
237
+ }
238
+ export declare function createFrontChannelAuthResponse(ctx: Context<{
239
+ Bindings: Bindings;
240
+ Variables: Variables;
241
+ }>, params: CreateAuthResponseParams): Promise<Response>;
242
+ export declare function completeLogin(ctx: Context<{
243
+ Bindings: Bindings;
244
+ Variables: Variables;
245
+ }>, params: Omit<CreateAuthTokensParams, "client"> & {
246
+ client: EnrichedClient;
247
+ responseType?: AuthorizationResponseType;
248
+ }): Promise<TokenResponse | {
249
+ code: string;
250
+ state?: string;
251
+ } | (TokenResponse & {
252
+ code: string;
253
+ }) | Response>;
@@ -0,0 +1,17 @@
1
+ import { Context } from "hono";
2
+ import { AuthParams } from "@authhero/adapter-interfaces";
3
+ import { EnrichedClient } from "../helpers/client";
4
+ import { Bindings, Variables } from "../types";
5
+ export declare function connectionAuth(ctx: Context<{
6
+ Bindings: Bindings;
7
+ Variables: Variables;
8
+ }>, client: EnrichedClient, connectionName: string, authParams: AuthParams): Promise<Response>;
9
+ interface SocialAuthCallbackParams {
10
+ code: string;
11
+ state: string;
12
+ }
13
+ export declare function connectionCallback(ctx: Context<{
14
+ Bindings: Bindings;
15
+ Variables: Variables;
16
+ }>, { code, state }: SocialAuthCallbackParams): Promise<Response>;
17
+ export {};
@@ -0,0 +1,49 @@
1
+ import { Context } from "hono";
2
+ import { LoginSession, AuthenticationMethod } from "@authhero/adapter-interfaces";
3
+ import { Bindings, Variables } from "../types";
4
+ import { EnrichedClient } from "../helpers/client";
5
+ export type MfaCheckResult = {
6
+ required: false;
7
+ } | {
8
+ required: true;
9
+ enrolled: false;
10
+ } | {
11
+ required: true;
12
+ enrolled: true;
13
+ enrollment: AuthenticationMethod;
14
+ allEnrollments: AuthenticationMethod[];
15
+ };
16
+ /**
17
+ * Check if MFA is required for a user based on tenant policy and enrollment status.
18
+ */
19
+ export declare function checkMfaRequired(ctx: Context<{
20
+ Bindings: Bindings;
21
+ Variables: Variables;
22
+ }>, tenantId: string, userId: string): Promise<MfaCheckResult>;
23
+ /**
24
+ * Send an MFA OTP code via SMS using the tenant's configured SMS provider.
25
+ */
26
+ export declare function sendMfaOtp(ctx: Context<{
27
+ Bindings: Bindings;
28
+ Variables: Variables;
29
+ }>, client: EnrichedClient, loginSession: LoginSession, phoneNumber: string): Promise<void>;
30
+ /**
31
+ * Verify an MFA OTP code against the stored code.
32
+ * Returns true if valid, false otherwise.
33
+ */
34
+ export declare function verifyMfaOtp(ctx: Context<{
35
+ Bindings: Bindings;
36
+ Variables: Variables;
37
+ }>, tenantId: string, loginSessionId: string, submittedCode: string): Promise<boolean>;
38
+ /**
39
+ * Generate a random TOTP secret and return it as a base32-encoded string.
40
+ */
41
+ export declare function generateTotpSecret(): string;
42
+ /**
43
+ * Create an otpauth:// URI for enrolling in TOTP (used for QR code generation).
44
+ */
45
+ export declare function createTotpUri(issuer: string, accountName: string, secretBase32: string): string;
46
+ /**
47
+ * Verify a TOTP code against a base32-encoded secret.
48
+ */
49
+ export declare function verifyTotpCode(secretBase32: string, code: string): Promise<boolean>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Passkey progressive enrollment — nudge logic
3
+ *
4
+ * Decides whether to show a passkey enrollment nudge to the user after login.
5
+ * Mirrors Auth0's progressive enrollment behaviour:
6
+ * 1. Connection must have progressive_enrollment_enabled + passkey enabled
7
+ * 2. User must have zero confirmed passkey/webauthn enrollments
8
+ * 3. User hasn't permanently opted out
9
+ * 4. User hasn't snoozed within the last 30 days
10
+ */
11
+ import { Context } from "hono";
12
+ import { Bindings, Variables } from "../types";
13
+ export interface PasskeyNudgeResult {
14
+ show: boolean;
15
+ }
16
+ export declare function checkPasskeyNudgeRequired(ctx: Context<{
17
+ Bindings: Bindings;
18
+ Variables: Variables;
19
+ }>, tenantId: string, userId: string, connectionName?: string): Promise<PasskeyNudgeResult>;
@@ -0,0 +1,24 @@
1
+ import { Context } from "hono";
2
+ import { AuthParams, LoginSession } from "@authhero/adapter-interfaces";
3
+ import { EnrichedClient } from "../helpers/client";
4
+ import { Bindings, GrantFlowUserResult, Variables } from "../types";
5
+ export declare function passwordGrant(ctx: Context<{
6
+ Bindings: Bindings;
7
+ Variables: Variables;
8
+ }>, client: EnrichedClient, authParams: AuthParams & {
9
+ password: string;
10
+ }, loginSession?: LoginSession, realm?: string): Promise<GrantFlowUserResult>;
11
+ export declare function loginWithPassword(ctx: Context<{
12
+ Bindings: Bindings;
13
+ Variables: Variables;
14
+ }>, client: EnrichedClient, authParams: AuthParams & {
15
+ password: string;
16
+ }, loginSession?: LoginSession, ticketAuth?: boolean, realm?: string): Promise<Response>;
17
+ export declare function changePassword(ctx: Context<{
18
+ Bindings: Bindings;
19
+ Variables: Variables;
20
+ }>, client: EnrichedClient, userId: string, newPassword: string, connectionName: string): Promise<void>;
21
+ export declare function requestPasswordReset(ctx: Context<{
22
+ Bindings: Bindings;
23
+ Variables: Variables;
24
+ }>, client: EnrichedClient, email: string, state: string, verification_method?: "link" | "code"): Promise<void>;