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.
- package/dist/assets/u/widget/index.esm.js +1 -1
- package/dist/authhero.cjs +135 -135
- package/dist/authhero.d.ts +17853 -72311
- package/dist/authhero.mjs +16401 -16771
- package/dist/stats.html +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/adapters/cache/in-memory.d.ts +52 -0
- package/dist/types/adapters/cache/index.d.ts +2 -0
- package/dist/types/adapters/index.d.ts +1 -0
- package/dist/types/authentication-flows/auth0-migration.d.ts +53 -0
- package/dist/types/authentication-flows/authorization-code.d.ts +23 -0
- package/dist/types/authentication-flows/client-credentials.d.ts +16 -0
- package/dist/types/authentication-flows/common.d.ts +253 -0
- package/dist/types/authentication-flows/connection.d.ts +17 -0
- package/dist/types/authentication-flows/mfa.d.ts +49 -0
- package/dist/types/authentication-flows/passkey-enrollment.d.ts +19 -0
- package/dist/types/authentication-flows/password.d.ts +24 -0
- package/dist/types/authentication-flows/passwordless.d.ts +571 -0
- package/dist/types/authentication-flows/refresh-token-migration.d.ts +17 -0
- package/dist/types/authentication-flows/refresh-token.d.ts +15 -0
- package/dist/types/authentication-flows/resume.d.ts +22 -0
- package/dist/types/authentication-flows/silent.d.ts +25 -0
- package/dist/types/authentication-flows/ticket.d.ts +7 -0
- package/dist/types/authentication-flows/try-connection.d.ts +33 -0
- package/dist/types/authentication-flows/universal.d.ts +19 -0
- package/dist/types/build-hash.d.ts +7 -0
- package/dist/types/client/client-bundle.d.ts +1 -0
- package/dist/types/client/form-handler.d.ts +9 -0
- package/dist/types/client/incognito-handler.d.ts +5 -0
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/input-otp.d.ts +12 -0
- package/dist/types/client/password-toggle.d.ts +10 -0
- package/dist/types/client/user-agent-detector.d.ts +22 -0
- package/dist/types/components/AccountChangeEmailPage.d.ts +14 -0
- package/dist/types/components/AccountForm.d.ts +17 -0
- package/dist/types/components/AccountPage.d.ts +15 -0
- package/dist/types/components/AppLogo.d.ts +8 -0
- package/dist/types/components/AuthLayout.d.ts +18 -0
- package/dist/types/components/Button.d.ts +12 -0
- package/dist/types/components/ChangeEmailForm.d.ts +14 -0
- package/dist/types/components/ChangeEmailPage.d.ts +15 -0
- package/dist/types/components/ContinueForm.d.ts +13 -0
- package/dist/types/components/EmailValidatedForm.d.ts +12 -0
- package/dist/types/components/EmailValidatedPage.d.ts +11 -0
- package/dist/types/components/EnterCodeForm.d.ts +13 -0
- package/dist/types/components/EnterCodePage.d.ts +14 -0
- package/dist/types/components/EnterPasswordForm.d.ts +14 -0
- package/dist/types/components/EnterPasswordPage.d.ts +13 -0
- package/dist/types/components/ErrorMessage.d.ts +6 -0
- package/dist/types/components/Footer.d.ts +9 -0
- package/dist/types/components/ForgotPasswordForm.d.ts +14 -0
- package/dist/types/components/ForgotPasswordPage.d.ts +13 -0
- package/dist/types/components/ForgotPasswordSentPage.d.ts +11 -0
- package/dist/types/components/Form.d.ts +6 -0
- package/dist/types/components/FormNodePage.d.ts +16 -0
- package/dist/types/components/GoBack.d.ts +5 -0
- package/dist/types/components/GoogleLogo.d.ts +4 -0
- package/dist/types/components/Icon.d.ts +8 -0
- package/dist/types/components/IconEye.d.ts +8 -0
- package/dist/types/components/IconEyeSlash.d.ts +8 -0
- package/dist/types/components/IconPen.d.ts +7 -0
- package/dist/types/components/IdentifierForm.d.ts +16 -0
- package/dist/types/components/IdentifierPage.d.ts +15 -0
- package/dist/types/components/ImpersonateForm.d.ts +14 -0
- package/dist/types/components/ImpersonationPage.d.ts +13 -0
- package/dist/types/components/InvalidSessionPage.d.ts +11 -0
- package/dist/types/components/Layout.d.ts +11 -0
- package/dist/types/components/LoginForm.d.ts +15 -0
- package/dist/types/components/MessagePage.d.ts +13 -0
- package/dist/types/components/PasswordInput.d.ts +6 -0
- package/dist/types/components/PreSignUpConfirmationPage.d.ts +12 -0
- package/dist/types/components/PreSignUpPage.d.ts +12 -0
- package/dist/types/components/ResetPasswordForm.d.ts +14 -0
- package/dist/types/components/ResetPasswordPage.d.ts +12 -0
- package/dist/types/components/SignUpForm.d.ts +15 -0
- package/dist/types/components/SignUpPage.d.ts +14 -0
- package/dist/types/components/SocialButton.d.ts +10 -0
- package/dist/types/components/Spinner.d.ts +6 -0
- package/dist/types/components/Trans.d.ts +8 -0
- package/dist/types/components/UnverifiedEmailPage.d.ts +11 -0
- package/dist/types/components/UserNotFoundPage.d.ts +12 -0
- package/dist/types/components/VippsLogo.d.ts +4 -0
- package/dist/types/components/index.d.ts +34 -0
- package/dist/types/components/stories/AccountForm.stories.d.ts +13 -0
- package/dist/types/components/stories/AuthLayout.stories.d.ts +27 -0
- package/dist/types/components/stories/ChangeEmailForm.stories.d.ts +11 -0
- package/dist/types/components/stories/ContinueForm.stories.d.ts +10 -0
- package/dist/types/components/stories/EnterCodeForm.stories.d.ts +9 -0
- package/dist/types/components/stories/EnterPasswordForm.stories.d.ts +22 -0
- package/dist/types/components/stories/IdentifierForm.stories.d.ts +42 -0
- package/dist/types/components/stories/IdentifierPage.stories.d.ts +33 -0
- package/dist/types/components/stories/ImpersonateForm.stories.d.ts +11 -0
- package/dist/types/components/stories/LoginForm.stories.d.ts +12 -0
- package/dist/types/components/ui/button.d.ts +12 -0
- package/dist/types/components/ui/card.d.ts +30 -0
- package/dist/types/components/ui/input-otp.d.ts +31 -0
- package/dist/types/components/ui/input.d.ts +15 -0
- package/dist/types/components/ui/label.d.ts +9 -0
- package/dist/types/constants/defaultBranding.d.ts +2 -0
- package/dist/types/constants/defaultTheme.d.ts +2 -0
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/constants.d.ts +15 -0
- package/dist/types/email-services/index.d.ts +3 -0
- package/dist/types/email-services/mailgun.d.ts +18 -0
- package/dist/types/email-services/postmark.d.ts +14 -0
- package/dist/types/email-services/resend.d.ts +14 -0
- package/dist/types/emails/defaults/Layout.d.ts +12 -0
- package/dist/types/emails/defaults/PrimaryButton.d.ts +11 -0
- package/dist/types/emails/defaults/ResetEmail.d.ts +1 -0
- package/dist/types/emails/defaults/ResetEmailByCode.d.ts +1 -0
- package/dist/types/emails/defaults/UserInvitation.d.ts +1 -0
- package/dist/types/emails/defaults/VerifyEmail.d.ts +1 -0
- package/dist/types/emails/defaults/VerifyEmailByCode.d.ts +1 -0
- package/dist/types/emails/defaults/WelcomeEmail.d.ts +1 -0
- package/dist/types/emails/defaults/compiled.d.ts +2 -0
- package/dist/types/emails/defaults/index.d.ts +6 -0
- package/dist/types/emails/defaults/subjects.d.ts +2 -0
- package/dist/types/emails/index.d.ts +70 -0
- package/dist/types/emails/render.d.ts +41 -0
- package/dist/types/errors/is-unique-constraint-error.d.ts +8 -0
- package/dist/types/errors/json-http-exception.d.ts +5 -0
- package/dist/types/errors/redirect-exception.d.ts +6 -0
- package/dist/types/generated/locale-types.d.ts +690 -0
- package/dist/types/helpers/cache-wrapper.d.ts +23 -0
- package/dist/types/helpers/client-assertion.d.ts +49 -0
- package/dist/types/helpers/client-keys.d.ts +27 -0
- package/dist/types/helpers/client.d.ts +496 -0
- package/dist/types/helpers/dcr/constraint-enforcement.d.ts +24 -0
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +83 -0
- package/dist/types/helpers/dcr/mint-iat.d.ts +14 -0
- package/dist/types/helpers/dcr/mint-token.d.ts +7 -0
- package/dist/types/helpers/dcr/validate-connect-origin.d.ts +20 -0
- package/dist/types/helpers/dcr/verify-token.d.ts +8 -0
- package/dist/types/helpers/default-destinations.d.ts +55 -0
- package/dist/types/helpers/entity-hooks-wrapper.d.ts +43 -0
- package/dist/types/helpers/hook-events.d.ts +20 -0
- package/dist/types/helpers/hook-user-payload.d.ts +8 -0
- package/dist/types/helpers/hrd.d.ts +3 -0
- package/dist/types/helpers/logging.d.ts +65 -0
- package/dist/types/helpers/outbox-cleanup.d.ts +10 -0
- package/dist/types/helpers/outbox-destinations/index.d.ts +2 -0
- package/dist/types/helpers/outbox-destinations/log-streams.d.ts +66 -0
- package/dist/types/helpers/outbox-destinations/logs.d.ts +20 -0
- package/dist/types/helpers/outbox-destinations/registration-finalizer.d.ts +29 -0
- package/dist/types/helpers/outbox-destinations/webhooks.d.ts +57 -0
- package/dist/types/helpers/outbox-relay.d.ts +34 -0
- package/dist/types/helpers/password-policy.d.ts +54 -0
- package/dist/types/helpers/request-object.d.ts +40 -0
- package/dist/types/helpers/run-outbox-relay.d.ts +58 -0
- package/dist/types/helpers/saml.d.ts +1 -0
- package/dist/types/helpers/scope-claims.d.ts +4 -0
- package/dist/types/helpers/scopes-permissions.d.ts +38 -0
- package/dist/types/helpers/server-timing.d.ts +12 -0
- package/dist/types/helpers/service-token.d.ts +54 -0
- package/dist/types/helpers/set-tenant-id.d.ts +15 -0
- package/dist/types/helpers/signing-keys.d.ts +16 -0
- package/dist/types/helpers/try-connection-client.d.ts +15 -0
- package/dist/types/helpers/user-linking.d.ts +14 -0
- package/dist/types/helpers/user-session-cleanup.d.ts +21 -0
- package/dist/types/helpers/users.d.ts +46 -0
- package/dist/types/helpers/wait-until.d.ts +21 -0
- package/dist/types/hooks/addDataHooks.d.ts +16 -0
- package/dist/types/hooks/code-executor/local.d.ts +13 -0
- package/dist/types/hooks/codehooks.d.ts +70 -0
- package/dist/types/hooks/formhooks.d.ts +99 -0
- package/dist/types/hooks/helpers/token-api.d.ts +17 -0
- package/dist/types/hooks/index.d.ts +20 -0
- package/dist/types/hooks/link-users.d.ts +29 -0
- package/dist/types/hooks/pagehooks.d.ts +16 -0
- package/dist/types/hooks/post-user-login.d.ts +29 -0
- package/dist/types/hooks/pre-defined/account-linking.d.ts +73 -0
- package/dist/types/hooks/pre-defined/ensure-username.d.ts +86 -0
- package/dist/types/hooks/pre-defined/index.d.ts +23 -0
- package/dist/types/hooks/pre-defined/set-preferred-username.d.ts +26 -0
- package/dist/types/hooks/templatehooks.d.ts +29 -0
- package/dist/types/hooks/user-deletion.d.ts +14 -0
- package/dist/types/hooks/user-registration.d.ts +88 -0
- package/dist/types/hooks/user-update.d.ts +16 -0
- package/dist/types/hooks/validate-signup.d.ts +34 -0
- package/dist/types/hooks/webhooks.d.ts +35 -0
- package/dist/types/i18n/index.d.ts +77 -0
- package/dist/types/index.d.ts +16022 -0
- package/dist/types/locales/index.d.ts +9 -0
- package/dist/types/middlewares/apply-config.d.ts +14 -0
- package/dist/types/middlewares/authentication.d.ts +26 -0
- package/dist/types/middlewares/client-info.d.ts +8 -0
- package/dist/types/middlewares/index.d.ts +6 -0
- package/dist/types/middlewares/outbox.d.ts +24 -0
- package/dist/types/middlewares/register-component.d.ts +10 -0
- package/dist/types/middlewares/tenant.d.ts +12 -0
- package/dist/types/migration-providers/auth0.d.ts +3 -0
- package/dist/types/migration-providers/index.d.ts +5 -0
- package/dist/types/migration-providers/types.d.ts +32 -0
- package/dist/types/routes/auth-api/account.d.ts +36 -0
- package/dist/types/routes/auth-api/authenticate.d.ts +31 -0
- package/dist/types/routes/auth-api/authorize.d.ts +239 -0
- package/dist/types/routes/auth-api/callback.d.ts +234 -0
- package/dist/types/routes/auth-api/connect-start.d.ts +52 -0
- package/dist/types/routes/auth-api/dbconnections.d.ts +43 -0
- package/dist/types/routes/auth-api/index.d.ts +1580 -0
- package/dist/types/routes/auth-api/logout.d.ts +20 -0
- package/dist/types/routes/auth-api/oidc-logout.d.ts +52 -0
- package/dist/types/routes/auth-api/passwordless.d.ts +154 -0
- package/dist/types/routes/auth-api/register/index.d.ts +159 -0
- package/dist/types/routes/auth-api/register/shared.d.ts +30 -0
- package/dist/types/routes/auth-api/revoke.d.ts +73 -0
- package/dist/types/routes/auth-api/token.d.ts +412 -0
- package/dist/types/routes/auth-api/userinfo.d.ts +84 -0
- package/dist/types/routes/auth-api/well-known.d.ts +74 -0
- package/dist/types/routes/management-api/action-executions.d.ts +90 -0
- package/dist/types/routes/management-api/action-triggers.d.ts +118 -0
- package/dist/types/routes/management-api/actions.d.ts +673 -0
- package/dist/types/routes/management-api/analytics.d.ts +18 -0
- package/dist/types/routes/management-api/attack-protection.d.ts +189 -0
- package/dist/types/routes/management-api/authentication-methods.d.ts +115 -0
- package/dist/types/routes/management-api/branding.d.ts +402 -0
- package/dist/types/routes/management-api/client-grants.d.ts +183 -0
- package/dist/types/routes/management-api/client-registration-tokens.d.ts +35 -0
- package/dist/types/routes/management-api/clients.d.ts +995 -0
- package/dist/types/routes/management-api/connections.d.ts +872 -0
- package/dist/types/routes/management-api/custom-domains.d.ts +266 -0
- package/dist/types/routes/management-api/email-templates.d.ts +205 -0
- package/dist/types/routes/management-api/emails.d.ts +124 -0
- package/dist/types/routes/management-api/failed-events.d.ts +146 -0
- package/dist/types/routes/management-api/flows.d.ts +438 -0
- package/dist/types/routes/management-api/forms.d.ts +4090 -0
- package/dist/types/routes/management-api/guardian.d.ts +211 -0
- package/dist/types/routes/management-api/hook-code.d.ts +142 -0
- package/dist/types/routes/management-api/hooks.d.ts +405 -0
- package/dist/types/routes/management-api/index.d.ts +13277 -0
- package/dist/types/routes/management-api/keys.d.ts +98 -0
- package/dist/types/routes/management-api/log-streams.d.ts +170 -0
- package/dist/types/routes/management-api/logs.d.ts +159 -0
- package/dist/types/routes/management-api/migration-sources.d.ts +173 -0
- package/dist/types/routes/management-api/organizations.d.ts +896 -0
- package/dist/types/routes/management-api/prompts.d.ts +150 -0
- package/dist/types/routes/management-api/refresh_tokens.d.ts +66 -0
- package/dist/types/routes/management-api/resource-servers.d.ts +321 -0
- package/dist/types/routes/management-api/roles.d.ts +260 -0
- package/dist/types/routes/management-api/sessions.d.ts +78 -0
- package/dist/types/routes/management-api/stats.d.ts +44 -0
- package/dist/types/routes/management-api/tenants.d.ts +546 -0
- package/dist/types/routes/management-api/themes.d.ts +265 -0
- package/dist/types/routes/management-api/tickets.d.ts +75 -0
- package/dist/types/routes/management-api/users-by-email.d.ts +90 -0
- package/dist/types/routes/management-api/users.d.ts +1085 -0
- package/dist/types/routes/saml/index.d.ts +64 -0
- package/dist/types/routes/saml/samlp.d.ts +64 -0
- package/dist/types/routes/setup.d.ts +6 -0
- package/dist/types/routes/universal-login/account-change-email-confirmation.d.ts +30 -0
- package/dist/types/routes/universal-login/account-change-email-verify.d.ts +66 -0
- package/dist/types/routes/universal-login/account-change-email.d.ts +58 -0
- package/dist/types/routes/universal-login/account.d.ts +64 -0
- package/dist/types/routes/universal-login/common.d.ts +1482 -0
- package/dist/types/routes/universal-login/continue.d.ts +37 -0
- package/dist/types/routes/universal-login/enter-password.d.ts +49 -0
- package/dist/types/routes/universal-login/error-handler.d.ts +14 -0
- package/dist/types/routes/universal-login/error-page.d.ts +32 -0
- package/dist/types/routes/universal-login/error.d.ts +20 -0
- package/dist/types/routes/universal-login/flow-api.d.ts +381 -0
- package/dist/types/routes/universal-login/flow-widget.d.ts +23 -0
- package/dist/types/routes/universal-login/forgot-password.d.ts +32 -0
- package/dist/types/routes/universal-login/form-node.d.ts +74 -0
- package/dist/types/routes/universal-login/identifier.d.ts +55 -0
- package/dist/types/routes/universal-login/impersonate.d.ts +71 -0
- package/dist/types/routes/universal-login/index.d.ts +748 -0
- package/dist/types/routes/universal-login/info.d.ts +20 -0
- package/dist/types/routes/universal-login/invalid-session.d.ts +19 -0
- package/dist/types/routes/universal-login/otp-challenge.d.ts +54 -0
- package/dist/types/routes/universal-login/pre-signup-sent.d.ts +19 -0
- package/dist/types/routes/universal-login/pre-signup.d.ts +32 -0
- package/dist/types/routes/universal-login/reset-password.d.ts +39 -0
- package/dist/types/routes/universal-login/sanitization-utils.d.ts +55 -0
- package/dist/types/routes/universal-login/screen-api.d.ts +20 -0
- package/dist/types/routes/universal-login/screens/accept-invitation.d.ts +13 -0
- package/dist/types/routes/universal-login/screens/account-delete.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account-helpers.d.ts +13 -0
- package/dist/types/routes/universal-login/screens/account-linked.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account-mfa-phone-enrollment.d.ts +10 -0
- package/dist/types/routes/universal-login/screens/account-mfa-totp-enrollment.d.ts +10 -0
- package/dist/types/routes/universal-login/screens/account-passkeys.d.ts +10 -0
- package/dist/types/routes/universal-login/screens/account-profile.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account-security.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/connect-consent.d.ts +9 -0
- package/dist/types/routes/universal-login/screens/connect-tenant-select.d.ts +13 -0
- package/dist/types/routes/universal-login/screens/email-otp-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/enter-password.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/forgot-password.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/identifier.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/impersonate.d.ts +15 -0
- package/dist/types/routes/universal-login/screens/index.d.ts +29 -0
- package/dist/types/routes/universal-login/screens/login-passwordless-identifier.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/login.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/magic-link-sent.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/mfa-login-options.d.ts +21 -0
- package/dist/types/routes/universal-login/screens/mfa-phone-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/mfa-phone-enrollment.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/mfa-totp-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/mfa-totp-enrollment.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/passkey-challenge.d.ts +16 -0
- package/dist/types/routes/universal-login/screens/passkey-enrollment-nudge.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/passkey-enrollment.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/passkey-utils.d.ts +100 -0
- package/dist/types/routes/universal-login/screens/registry.d.ts +28 -0
- package/dist/types/routes/universal-login/screens/reset-password-code.d.ts +18 -0
- package/dist/types/routes/universal-login/screens/reset-password.d.ts +36 -0
- package/dist/types/routes/universal-login/screens/signup.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/sms-otp-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/try-connection-result.d.ts +12 -0
- package/dist/types/routes/universal-login/screens/types.d.ts +167 -0
- package/dist/types/routes/universal-login/signup.d.ts +54 -0
- package/dist/types/routes/universal-login/u2-form-node.d.ts +93 -0
- package/dist/types/routes/universal-login/u2-index.d.ts +337 -0
- package/dist/types/routes/universal-login/u2-routes.d.ts +262 -0
- package/dist/types/routes/universal-login/u2-widget-page.d.ts +187 -0
- package/dist/types/routes/universal-login/universal-login-template.d.ts +55 -0
- package/dist/types/routes/universal-login/validate-email.d.ts +20 -0
- package/dist/types/routes/universal-login/widget-routes.d.ts +81 -0
- package/dist/types/seed.d.ts +86 -0
- package/dist/types/state-machines/index.d.ts +1 -0
- package/dist/types/state-machines/login-session.d.ts +173 -0
- package/dist/types/storybook-utils/HonoJSXWrapper.d.ts +43 -0
- package/dist/types/strategies/apple.d.ts +24 -0
- package/dist/types/strategies/facebook.d.ts +20 -0
- package/dist/types/strategies/github.d.ts +23 -0
- package/dist/types/strategies/google-oauth2.d.ts +43 -0
- package/dist/types/strategies/index.d.ts +69 -0
- package/dist/types/strategies/internal-oauth2.d.ts +17 -0
- package/dist/types/strategies/microsoft.d.ts +24 -0
- package/dist/types/strategies/oauth2.d.ts +38 -0
- package/dist/types/strategies/oidc.d.ts +38 -0
- package/dist/types/strategies/saml.d.ts +9 -0
- package/dist/types/strategies/vipps.d.ts +16 -0
- package/dist/types/styles/index.d.ts +9 -0
- package/dist/types/styles/tailwind.d.ts +1 -0
- package/dist/types/types/Auth0Client.d.ts +9 -0
- package/dist/types/types/AuthError.d.ts +14 -0
- package/dist/types/types/AuthHeroConfig.d.ts +415 -0
- package/dist/types/types/Bindings.d.ts +51 -0
- package/dist/types/types/GrantFlowResult.d.ts +22 -0
- package/dist/types/types/Hooks.d.ts +240 -0
- package/dist/types/types/IdToken.d.ts +30 -0
- package/dist/types/types/UserInfo.d.ts +8 -0
- package/dist/types/types/Variables.d.ts +33 -0
- package/dist/types/types/auth0/Query.d.ts +12 -0
- package/dist/types/types/auth0/Totals.d.ts +11 -0
- package/dist/types/types/auth0/UserResponse.d.ts +46 -0
- package/dist/types/types/auth0/index.d.ts +3 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/saml.d.ts +1 -0
- package/dist/types/utils/append-log.d.ts +10 -0
- package/dist/types/utils/auth-header.d.ts +18 -0
- package/dist/types/utils/auth0-upstream.d.ts +60 -0
- package/dist/types/utils/authIframe.d.ts +11 -0
- package/dist/types/utils/client-info.d.ts +47 -0
- package/dist/types/utils/color.d.ts +23 -0
- package/dist/types/utils/connections.d.ts +11 -0
- package/dist/types/utils/cookies.d.ts +28 -0
- package/dist/types/utils/crypto.d.ts +2 -0
- package/dist/types/utils/deep-merge.d.ts +6 -0
- package/dist/types/utils/define-route.d.ts +20 -0
- package/dist/types/utils/encryption.d.ts +22 -0
- package/dist/types/utils/entity-id.d.ts +13 -0
- package/dist/types/utils/fetchAll.d.ts +60 -0
- package/dist/types/utils/form-post.d.ts +1 -0
- package/dist/types/utils/id-token-hash.d.ts +1 -0
- package/dist/types/utils/incognito.d.ts +11 -0
- package/dist/types/utils/instance-to-json.d.ts +8 -0
- package/dist/types/utils/ip.d.ts +8 -0
- package/dist/types/utils/is-valid-redirect-url.d.ts +4 -0
- package/dist/types/utils/jwk-alg.d.ts +20 -0
- package/dist/types/utils/jwks.d.ts +41 -0
- package/dist/types/utils/jwt.d.ts +15 -0
- package/dist/types/utils/organization-id.d.ts +2 -0
- package/dist/types/utils/otp.d.ts +1 -0
- package/dist/types/utils/refresh-token-format.d.ts +20 -0
- package/dist/types/utils/safe-compare.d.ts +1 -0
- package/dist/types/utils/sort.d.ts +4 -0
- package/dist/types/utils/ssrf-fetch.d.ts +44 -0
- package/dist/types/utils/ulid.d.ts +1 -0
- package/dist/types/utils/url.d.ts +16 -0
- package/dist/types/utils/user-id.d.ts +2 -0
- package/dist/types/utils/username-password-provider.d.ts +67 -0
- package/dist/types/utils/username.d.ts +11 -0
- package/dist/types/variables.d.ts +4 -0
- package/package.json +11 -11
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared widget page rendering for U2 routes.
|
|
3
|
+
*
|
|
4
|
+
* v3 — Logo inside widget by default + adaptive chip chrome.
|
|
5
|
+
*
|
|
6
|
+
* Changes vs. v2:
|
|
7
|
+
* - Logo renders INSIDE the widget card by default (Auth0-style). The
|
|
8
|
+
* widget's own shadow DOM emits the logo from `branding.logo_url`, so
|
|
9
|
+
* the page doesn't add an outer-container duplicate. Set
|
|
10
|
+
* `logoPosition="chip"` to render the floating-chip variant instead.
|
|
11
|
+
* - Chips adapt to dark/light page mode (translucent dark vs. translucent
|
|
12
|
+
* white). Tokens are CSS variables flipped via a `data-mode` attribute,
|
|
13
|
+
* so a single ruleset handles both directions.
|
|
14
|
+
* - When there's no background image, chips drop their pill surface and
|
|
15
|
+
* render as plain text (matches a clean solid-bg layout).
|
|
16
|
+
* - Privacy/Terms is now a real chip in the with-image case so it doesn't
|
|
17
|
+
* float as orphan text.
|
|
18
|
+
*
|
|
19
|
+
* ┌─────────────────────────────────────┐
|
|
20
|
+
* │ [logo*] [settings] │ *only when logoPosition=chip
|
|
21
|
+
* │ │
|
|
22
|
+
* │ ┌──────────┐ │
|
|
23
|
+
* │ │ [logo] │ │ <- widget's own header (default)
|
|
24
|
+
* │ │ widget │ │
|
|
25
|
+
* │ └──────────┘ │
|
|
26
|
+
* │ │
|
|
27
|
+
* │ [trust] [legal] │
|
|
28
|
+
* └─────────────────────────────────────┘
|
|
29
|
+
*
|
|
30
|
+
* Slot story (forward-looking): the chips carry `data-ah-slot` attrs so a
|
|
31
|
+
* future Liquid template can reposition any element via `{% slot %}` tags.
|
|
32
|
+
* `logoPosition` is the prop-level shortcut for the most common override.
|
|
33
|
+
*/
|
|
34
|
+
import type { Branding, Theme } from "@authhero/adapter-interfaces";
|
|
35
|
+
export type DarkModePreference = "auto" | "light" | "dark";
|
|
36
|
+
export type LogoPosition = "widget" | "chip" | "none";
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the dark-mode preference for the current request.
|
|
39
|
+
*
|
|
40
|
+
* Priority: per-user `ah-dark-mode` cookie > tenant `branding.dark_mode` > "auto".
|
|
41
|
+
* The cookie lets a user override the tenant default for the rest of their session.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveDarkMode(ctx: any, branding: Branding | null | undefined): DarkModePreference;
|
|
44
|
+
export type WidgetPageProps = {
|
|
45
|
+
widgetHtml: string;
|
|
46
|
+
screenId: string;
|
|
47
|
+
branding?: {
|
|
48
|
+
colors?: {
|
|
49
|
+
primary?: string;
|
|
50
|
+
page_background?: string | {
|
|
51
|
+
type?: string;
|
|
52
|
+
start?: string;
|
|
53
|
+
end?: string;
|
|
54
|
+
angle_deg?: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
logo_url?: string;
|
|
58
|
+
favicon_url?: string;
|
|
59
|
+
font?: {
|
|
60
|
+
url?: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
theme?: any;
|
|
64
|
+
themePageBackground?: {
|
|
65
|
+
background_color?: string;
|
|
66
|
+
background_image_url?: string;
|
|
67
|
+
page_layout?: string;
|
|
68
|
+
};
|
|
69
|
+
clientName: string;
|
|
70
|
+
poweredByLogo?: {
|
|
71
|
+
url: string;
|
|
72
|
+
darkUrl?: string;
|
|
73
|
+
alt: string;
|
|
74
|
+
href?: string;
|
|
75
|
+
height?: number;
|
|
76
|
+
};
|
|
77
|
+
language?: string;
|
|
78
|
+
availableLanguages?: string[];
|
|
79
|
+
termsAndConditionsUrl?: string;
|
|
80
|
+
darkMode?: DarkModePreference;
|
|
81
|
+
/**
|
|
82
|
+
* Where to render the tenant logo on the page.
|
|
83
|
+
* - "widget" (default): inside the widget card, via the widget's own header.
|
|
84
|
+
* - "chip": floating pill in the top-left page corner. The widget's
|
|
85
|
+
* internal logo should also be suppressed in this mode (callers use
|
|
86
|
+
* `derivePageLogoPlacement` to clone the theme accordingly before SSR).
|
|
87
|
+
* - "none": no logo on the page or in the widget.
|
|
88
|
+
*
|
|
89
|
+
* If not provided, defaults to `theme.page_background.logo_placement`,
|
|
90
|
+
* falling back to "widget".
|
|
91
|
+
*/
|
|
92
|
+
logoPosition?: LogoPosition;
|
|
93
|
+
/** Optional inline script injected at page level (e.g. WebAuthn ceremony) */
|
|
94
|
+
extraScript?: string;
|
|
95
|
+
/**
|
|
96
|
+
* When set, replaces the default body content (widget + chips) with a
|
|
97
|
+
* pre-expanded HTML fragment. Used by the universal-login custom-template
|
|
98
|
+
* path: the tenant's template is run through `applyUniversalLoginTemplate`
|
|
99
|
+
* and the resulting body markup is injected here, while the page shell
|
|
100
|
+
* (html/head, dark-mode runtime, background tint, body styling) is still
|
|
101
|
+
* managed by this component.
|
|
102
|
+
*/
|
|
103
|
+
customBodyHtml?: string;
|
|
104
|
+
};
|
|
105
|
+
export declare function LogoChip({ logoUrl, clientName, }: {
|
|
106
|
+
logoUrl?: string | null;
|
|
107
|
+
clientName: string;
|
|
108
|
+
}): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
109
|
+
export declare function DarkModeToggle({ darkMode }: {
|
|
110
|
+
darkMode: DarkModePreference;
|
|
111
|
+
}): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
112
|
+
export declare function LanguagePicker({ language, availableLanguages, }: {
|
|
113
|
+
language?: string;
|
|
114
|
+
availableLanguages: string[];
|
|
115
|
+
}): import("hono/jsx/jsx-dev-runtime").JSX.Element | null;
|
|
116
|
+
export declare function SettingsChip({ darkMode, language, availableLanguages, }: {
|
|
117
|
+
darkMode: DarkModePreference;
|
|
118
|
+
language?: string;
|
|
119
|
+
availableLanguages?: string[];
|
|
120
|
+
}): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
121
|
+
export declare function PoweredByChip({ url, href, alt, height, }: {
|
|
122
|
+
url: string;
|
|
123
|
+
href?: string;
|
|
124
|
+
alt?: string;
|
|
125
|
+
height?: number;
|
|
126
|
+
}): import("hono/jsx/jsx-dev-runtime").JSX.Element | null;
|
|
127
|
+
export declare function LegalChip({ termsAndConditionsUrl, language, }: {
|
|
128
|
+
termsAndConditionsUrl?: string;
|
|
129
|
+
language?: string;
|
|
130
|
+
}): import("hono/jsx/jsx-dev-runtime").JSX.Element | null;
|
|
131
|
+
export declare function WidgetPage({ widgetHtml, screenId, branding, theme, themePageBackground, clientName, poweredByLogo, language, availableLanguages, termsAndConditionsUrl, darkMode, logoPosition, extraScript, customBodyHtml, }: WidgetPageProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
132
|
+
/**
|
|
133
|
+
* Reads `theme.page_background.logo_placement` and returns the resolved
|
|
134
|
+
* page-level `logoPosition` plus a theme variant suitable for passing to
|
|
135
|
+
* the widget SSR. When placement is "chip" or "none" we override
|
|
136
|
+
* `theme.widget.logo_position = "none"` so the widget's internal header
|
|
137
|
+
* logo is suppressed — otherwise we'd render a duplicate (chip + widget
|
|
138
|
+
* header) or a logo when the caller asked for none.
|
|
139
|
+
*
|
|
140
|
+
* Callers should pass the returned `theme` to `JSON.stringify` for the
|
|
141
|
+
* widget's `theme` attribute, and forward `logoPosition` to `WidgetPage`.
|
|
142
|
+
*/
|
|
143
|
+
export declare function derivePageLogoPlacement<T extends {
|
|
144
|
+
page_background?: {
|
|
145
|
+
logo_placement?: LogoPosition;
|
|
146
|
+
};
|
|
147
|
+
widget?: {
|
|
148
|
+
logo_position?: string;
|
|
149
|
+
};
|
|
150
|
+
} | null | undefined>(theme: T): {
|
|
151
|
+
logoPosition: LogoPosition;
|
|
152
|
+
theme: T;
|
|
153
|
+
};
|
|
154
|
+
export declare function renderWidgetSSR(params: {
|
|
155
|
+
screenId: string;
|
|
156
|
+
screenJson: string;
|
|
157
|
+
brandingJson?: string;
|
|
158
|
+
themeJson?: string;
|
|
159
|
+
state: string;
|
|
160
|
+
authParamsJson: string;
|
|
161
|
+
}): Promise<string>;
|
|
162
|
+
export declare function extractBrandingProps(branding: Branding | null | undefined): WidgetPageProps["branding"];
|
|
163
|
+
export declare function renderWidgetPageResponse(ctx: any, opts: {
|
|
164
|
+
screenId: string;
|
|
165
|
+
screenJson: string;
|
|
166
|
+
brandingJson?: string;
|
|
167
|
+
themeJson?: string;
|
|
168
|
+
state: string;
|
|
169
|
+
authParamsJson: string;
|
|
170
|
+
branding: Branding | null | undefined;
|
|
171
|
+
theme: Theme | null | undefined;
|
|
172
|
+
clientName: string;
|
|
173
|
+
poweredByLogo?: WidgetPageProps["poweredByLogo"];
|
|
174
|
+
language?: string;
|
|
175
|
+
availableLanguages?: string[];
|
|
176
|
+
termsAndConditionsUrl?: string;
|
|
177
|
+
darkMode?: DarkModePreference;
|
|
178
|
+
logoPosition?: LogoPosition;
|
|
179
|
+
extraScript?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Optional tenant-uploaded body template. When provided, the body is
|
|
182
|
+
* built via `applyUniversalLoginTemplate(customTemplateBody, ...)`
|
|
183
|
+
* instead of the default chip layout. The shell (html/head, runtime,
|
|
184
|
+
* bg tint) is unchanged.
|
|
185
|
+
*/
|
|
186
|
+
customTemplateBody?: string;
|
|
187
|
+
}): Promise<Response>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universal Login Template — slot-based body markup.
|
|
3
|
+
*
|
|
4
|
+
* Tenants opt into custom chrome by uploading a body fragment that uses these
|
|
5
|
+
* slot tokens. The default body (`DEFAULT_UNIVERSAL_LOGIN_TEMPLATE`) is
|
|
6
|
+
* what's served when no custom template is stored, and is what tenants
|
|
7
|
+
* should copy and edit.
|
|
8
|
+
*
|
|
9
|
+
* The page shell (`<!DOCTYPE>`, `<html>`, `<head>`, body styles, dark-mode
|
|
10
|
+
* runtime, background tint) is fixed in code — it's not part of the tenant
|
|
11
|
+
* template. This keeps tenants out of CSS/runtime authoring and limits
|
|
12
|
+
* customization to layout: hide a chip by deleting its token, reorder by
|
|
13
|
+
* moving them.
|
|
14
|
+
*
|
|
15
|
+
* Slot tokens:
|
|
16
|
+
* `{%- auth0:widget -%}` — widget container (required)
|
|
17
|
+
* `{%- authhero:logo -%}` — logo chip (top-left)
|
|
18
|
+
* `{%- authhero:settings -%}` — settings chip (top-right), wraps the
|
|
19
|
+
* dark-mode toggle + language picker
|
|
20
|
+
* `{%- authhero:dark-mode-toggle -%}`— dark-mode button only
|
|
21
|
+
* `{%- authhero:language-picker -%}` — language picker only
|
|
22
|
+
* `{%- authhero:powered-by -%}` — powered-by chip (bottom-left)
|
|
23
|
+
* `{%- authhero:legal -%}` — legal/terms chip (bottom-right)
|
|
24
|
+
*/
|
|
25
|
+
import { type DarkModePreference } from "./u2-widget-page";
|
|
26
|
+
export declare const REQUIRED_SLOT = "{%- auth0:widget -%}";
|
|
27
|
+
/**
|
|
28
|
+
* Canonical default body. Mirrors the layout the JSX `WidgetPage` emits.
|
|
29
|
+
* Tenants who want to hide a chip should copy this, delete a slot, and PUT
|
|
30
|
+
* it back via `PUT /api/v2/branding/templates/universal-login`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEFAULT_UNIVERSAL_LOGIN_TEMPLATE = "{%- auth0:widget -%}\n{%- authhero:logo -%}\n{%- authhero:settings -%}\n{%- authhero:powered-by -%}\n{%- authhero:legal -%}\n";
|
|
33
|
+
export type TemplateSlotOptions = {
|
|
34
|
+
widgetHtml: string;
|
|
35
|
+
logoUrl?: string | null;
|
|
36
|
+
clientName: string;
|
|
37
|
+
darkMode: DarkModePreference;
|
|
38
|
+
language?: string;
|
|
39
|
+
availableLanguages?: string[];
|
|
40
|
+
poweredBy?: {
|
|
41
|
+
url: string;
|
|
42
|
+
href?: string;
|
|
43
|
+
alt?: string;
|
|
44
|
+
height?: number;
|
|
45
|
+
};
|
|
46
|
+
termsAndConditionsUrl?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Expand slot tokens in a template body. Unknown tokens are left in place
|
|
50
|
+
* (so tenants can spot typos in their templates).
|
|
51
|
+
*/
|
|
52
|
+
export declare function applyUniversalLoginTemplate(template: string, opts: TemplateSlotOptions & {
|
|
53
|
+
screenId: string;
|
|
54
|
+
widgetContainerStyle?: string;
|
|
55
|
+
}): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { Bindings, Variables } from "../../types";
|
|
3
|
+
export declare const validateEmailRoutes: OpenAPIHono<{
|
|
4
|
+
Bindings: Bindings;
|
|
5
|
+
Variables: Variables;
|
|
6
|
+
}, {
|
|
7
|
+
"/": {
|
|
8
|
+
$get: {
|
|
9
|
+
input: {
|
|
10
|
+
query: {
|
|
11
|
+
state: string;
|
|
12
|
+
code: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
output: {};
|
|
16
|
+
outputFormat: string;
|
|
17
|
+
status: 200;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, "/">;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widget Routes - Universal Login with built-in screens (SSR + Hydration)
|
|
3
|
+
*
|
|
4
|
+
* These routes serve the widget UI for each screen in the login flow.
|
|
5
|
+
* The widget is server-side rendered for instant display, then hydrated
|
|
6
|
+
* on the client for interactivity.
|
|
7
|
+
*
|
|
8
|
+
* Route pattern: /u/widget/:screenId?state=...
|
|
9
|
+
*
|
|
10
|
+
* Available screens:
|
|
11
|
+
* - /u/widget/identifier - Email/username input (first screen)
|
|
12
|
+
* - /u/widget/email-otp-challenge - Email OTP code verification
|
|
13
|
+
* - /u/widget/sms-otp-challenge - SMS OTP code verification
|
|
14
|
+
* - /u/widget/enter-password - Password authentication
|
|
15
|
+
* - /u/widget/signup - New user registration
|
|
16
|
+
* - /u/widget/forgot-password - Password reset request
|
|
17
|
+
* - /u/widget/reset-password - Set new password
|
|
18
|
+
*/
|
|
19
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
20
|
+
import { Bindings, Variables } from "../../types";
|
|
21
|
+
export declare const widgetRoutes: OpenAPIHono<{
|
|
22
|
+
Bindings: Bindings;
|
|
23
|
+
Variables: Variables;
|
|
24
|
+
}, {
|
|
25
|
+
"/:screenId": {
|
|
26
|
+
$get: {
|
|
27
|
+
input: {
|
|
28
|
+
param: {
|
|
29
|
+
screenId: string;
|
|
30
|
+
};
|
|
31
|
+
} & {
|
|
32
|
+
query: {
|
|
33
|
+
state: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
output: Response;
|
|
37
|
+
outputFormat: "json";
|
|
38
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
39
|
+
} | {
|
|
40
|
+
input: {
|
|
41
|
+
param: {
|
|
42
|
+
screenId: string;
|
|
43
|
+
};
|
|
44
|
+
} & {
|
|
45
|
+
query: {
|
|
46
|
+
state: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
output: {};
|
|
50
|
+
outputFormat: string;
|
|
51
|
+
status: 404;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
} & {
|
|
55
|
+
"/:screenId": {
|
|
56
|
+
$post: {
|
|
57
|
+
input: {
|
|
58
|
+
param: {
|
|
59
|
+
screenId: string;
|
|
60
|
+
};
|
|
61
|
+
} & {
|
|
62
|
+
query: {
|
|
63
|
+
state: string;
|
|
64
|
+
action?: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
} & {
|
|
67
|
+
json: {
|
|
68
|
+
data: Record<string, any>;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
output: {
|
|
72
|
+
screen: any;
|
|
73
|
+
branding?: any;
|
|
74
|
+
} | {
|
|
75
|
+
redirect: string;
|
|
76
|
+
};
|
|
77
|
+
outputFormat: "json";
|
|
78
|
+
status: 200;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
}, "/">;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { DataAdapters } from "@authhero/adapter-interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Management API scopes for the AuthHero Management API
|
|
4
|
+
*/
|
|
5
|
+
export declare const MANAGEMENT_API_SCOPES: {
|
|
6
|
+
description: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[];
|
|
9
|
+
export interface SeedOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The admin user's username
|
|
12
|
+
*/
|
|
13
|
+
adminUsername: string;
|
|
14
|
+
/**
|
|
15
|
+
* The admin user's email address (optional)
|
|
16
|
+
*/
|
|
17
|
+
adminEmail?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The admin user's password (will be hashed with bcrypt)
|
|
20
|
+
*/
|
|
21
|
+
adminPassword: string;
|
|
22
|
+
/**
|
|
23
|
+
* The tenant ID to create (defaults to "control_plane")
|
|
24
|
+
*/
|
|
25
|
+
tenantId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The tenant name (defaults to "Control Plane")
|
|
28
|
+
*/
|
|
29
|
+
tenantName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The audience URL for the tenant.
|
|
32
|
+
* For the main/management tenant, defaults to `urn:authhero:management`.
|
|
33
|
+
*/
|
|
34
|
+
audience?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Whether this is the control plane tenant (the main management tenant).
|
|
37
|
+
* If true, the audience will default to `urn:authhero:management`.
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
isControlPlane?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The default client ID (defaults to "default")
|
|
43
|
+
*/
|
|
44
|
+
clientId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Callback URLs for the default client
|
|
47
|
+
*/
|
|
48
|
+
callbacks?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Allowed logout URLs for the default client
|
|
51
|
+
*/
|
|
52
|
+
allowedLogoutUrls?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Whether to log progress (defaults to true)
|
|
55
|
+
*/
|
|
56
|
+
debug?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The issuer URL (used to construct the Management API identifier)
|
|
59
|
+
*/
|
|
60
|
+
issuer?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SeedResult {
|
|
63
|
+
tenantId: string;
|
|
64
|
+
userId: string;
|
|
65
|
+
username: string;
|
|
66
|
+
clientId: string;
|
|
67
|
+
clientSecret: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Seed the AuthHero database with initial data.
|
|
71
|
+
* Creates a default tenant, admin user, password connection, and default client.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* import { seed } from "authhero";
|
|
76
|
+
* import createAdapters from "@authhero/kysely-adapter";
|
|
77
|
+
*
|
|
78
|
+
* const adapters = createAdapters(db);
|
|
79
|
+
*
|
|
80
|
+
* await seed(adapters, {
|
|
81
|
+
* adminUsername: "admin",
|
|
82
|
+
* adminPassword: "admin",
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function seed(adapters: DataAdapters, options: SeedOptions): Promise<SeedResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loginSessionMachine, transitionLoginSession, transitionLoginSessionFromEntity, canTransition, getValidEvents, LoginSessionEventType, type LoginSessionContext, type LoginSessionEvent, } from "./login-session";
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { LoginSession, LoginSessionState } from "@authhero/adapter-interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Context for the login session state machine
|
|
4
|
+
*/
|
|
5
|
+
export interface LoginSessionContext {
|
|
6
|
+
/** User ID once identified */
|
|
7
|
+
userId?: string;
|
|
8
|
+
/** Error/failure reason if login failed */
|
|
9
|
+
failureReason?: string;
|
|
10
|
+
/** Hook/flow ID if waiting for completion */
|
|
11
|
+
hookId?: string;
|
|
12
|
+
/** Continuation scope - which pages are allowed during AWAITING_CONTINUATION */
|
|
13
|
+
continuationScope?: string[];
|
|
14
|
+
/** Additional state data */
|
|
15
|
+
stateData?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Event types for the login session state machine
|
|
19
|
+
*/
|
|
20
|
+
export declare enum LoginSessionEventType {
|
|
21
|
+
AUTHENTICATE = "AUTHENTICATE",
|
|
22
|
+
REQUIRE_EMAIL_VERIFICATION = "REQUIRE_EMAIL_VERIFICATION",
|
|
23
|
+
REQUIRE_MFA = "REQUIRE_MFA",
|
|
24
|
+
COMPLETE_MFA = "COMPLETE_MFA",
|
|
25
|
+
START_HOOK = "START_HOOK",
|
|
26
|
+
COMPLETE_HOOK = "COMPLETE_HOOK",
|
|
27
|
+
START_CONTINUATION = "START_CONTINUATION",
|
|
28
|
+
COMPLETE_CONTINUATION = "COMPLETE_CONTINUATION",
|
|
29
|
+
COMPLETE = "COMPLETE",
|
|
30
|
+
FAIL = "FAIL",
|
|
31
|
+
EXPIRE = "EXPIRE"
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Events that can trigger state transitions
|
|
35
|
+
*/
|
|
36
|
+
export type LoginSessionEvent = {
|
|
37
|
+
type: LoginSessionEventType.AUTHENTICATE;
|
|
38
|
+
userId: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: LoginSessionEventType.REQUIRE_EMAIL_VERIFICATION;
|
|
41
|
+
} | {
|
|
42
|
+
type: LoginSessionEventType.REQUIRE_MFA;
|
|
43
|
+
} | {
|
|
44
|
+
type: LoginSessionEventType.COMPLETE_MFA;
|
|
45
|
+
} | {
|
|
46
|
+
type: LoginSessionEventType.START_HOOK;
|
|
47
|
+
hookId?: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: LoginSessionEventType.COMPLETE_HOOK;
|
|
50
|
+
} | {
|
|
51
|
+
type: LoginSessionEventType.START_CONTINUATION;
|
|
52
|
+
scope: string[];
|
|
53
|
+
} | {
|
|
54
|
+
type: LoginSessionEventType.COMPLETE_CONTINUATION;
|
|
55
|
+
} | {
|
|
56
|
+
type: LoginSessionEventType.COMPLETE;
|
|
57
|
+
} | {
|
|
58
|
+
type: LoginSessionEventType.FAIL;
|
|
59
|
+
reason: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: LoginSessionEventType.EXPIRE;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Login session state machine
|
|
65
|
+
*
|
|
66
|
+
* The AUTHENTICATED state acts as a "hub" that decides the next requirement.
|
|
67
|
+
* After completing hooks or continuations, the flow returns to AUTHENTICATED
|
|
68
|
+
* so the backend can check if additional steps are needed.
|
|
69
|
+
*
|
|
70
|
+
* Flow examples:
|
|
71
|
+
* pending → authenticated → completed (simple login)
|
|
72
|
+
* pending → authenticated → awaiting_email_verification → authenticated → completed
|
|
73
|
+
* pending → authenticated → awaiting_mfa → authenticated → completed
|
|
74
|
+
* pending → authenticated → awaiting_hook → authenticated → awaiting_continuation → authenticated → completed
|
|
75
|
+
*
|
|
76
|
+
* Any non-final state can transition to failed or expired.
|
|
77
|
+
*
|
|
78
|
+
* States:
|
|
79
|
+
* - pending: Initial state, awaiting user authentication
|
|
80
|
+
* - authenticated: Credentials validated - hub state that decides next steps
|
|
81
|
+
* - awaiting_email_verification: Blocked on email verification
|
|
82
|
+
* - awaiting_mfa: Waiting for MFA verification (SMS, TOTP, etc.)
|
|
83
|
+
* - awaiting_hook: Waiting for hook/flow completion (form, page, impersonate)
|
|
84
|
+
* - awaiting_continuation: Waiting for user to complete action on account page
|
|
85
|
+
* - completed: Tokens issued successfully (final)
|
|
86
|
+
* - failed: Authentication failed (final)
|
|
87
|
+
* - expired: Session timed out (final)
|
|
88
|
+
*/
|
|
89
|
+
export declare const loginSessionMachine: import("xstate").StateMachine<LoginSessionContext, {
|
|
90
|
+
type: LoginSessionEventType.AUTHENTICATE;
|
|
91
|
+
userId: string;
|
|
92
|
+
} | {
|
|
93
|
+
type: LoginSessionEventType.REQUIRE_EMAIL_VERIFICATION;
|
|
94
|
+
} | {
|
|
95
|
+
type: LoginSessionEventType.REQUIRE_MFA;
|
|
96
|
+
} | {
|
|
97
|
+
type: LoginSessionEventType.COMPLETE_MFA;
|
|
98
|
+
} | {
|
|
99
|
+
type: LoginSessionEventType.START_HOOK;
|
|
100
|
+
hookId?: string;
|
|
101
|
+
} | {
|
|
102
|
+
type: LoginSessionEventType.COMPLETE_HOOK;
|
|
103
|
+
} | {
|
|
104
|
+
type: LoginSessionEventType.START_CONTINUATION;
|
|
105
|
+
scope: string[];
|
|
106
|
+
} | {
|
|
107
|
+
type: LoginSessionEventType.COMPLETE_CONTINUATION;
|
|
108
|
+
} | {
|
|
109
|
+
type: LoginSessionEventType.COMPLETE;
|
|
110
|
+
} | {
|
|
111
|
+
type: LoginSessionEventType.FAIL;
|
|
112
|
+
reason: string;
|
|
113
|
+
} | {
|
|
114
|
+
type: LoginSessionEventType.EXPIRE;
|
|
115
|
+
}, {}, never, {
|
|
116
|
+
type: "setUserId";
|
|
117
|
+
params: import("xstate").NonReducibleUnknown;
|
|
118
|
+
} | {
|
|
119
|
+
type: "setHookId";
|
|
120
|
+
params: import("xstate").NonReducibleUnknown;
|
|
121
|
+
} | {
|
|
122
|
+
type: "clearHookId";
|
|
123
|
+
params: import("xstate").NonReducibleUnknown;
|
|
124
|
+
} | {
|
|
125
|
+
type: "setContinuationScope";
|
|
126
|
+
params: import("xstate").NonReducibleUnknown;
|
|
127
|
+
} | {
|
|
128
|
+
type: "clearContinuationScope";
|
|
129
|
+
params: import("xstate").NonReducibleUnknown;
|
|
130
|
+
} | {
|
|
131
|
+
type: "setFailureReason";
|
|
132
|
+
params: import("xstate").NonReducibleUnknown;
|
|
133
|
+
}, never, never, "pending" | "failed" | "authenticated" | "expired" | "awaiting_email_verification" | "awaiting_mfa" | "awaiting_hook" | "awaiting_continuation" | "completed", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
134
|
+
id: "loginSession";
|
|
135
|
+
states: {
|
|
136
|
+
readonly pending: {};
|
|
137
|
+
readonly authenticated: {};
|
|
138
|
+
readonly awaiting_email_verification: {};
|
|
139
|
+
readonly awaiting_mfa: {};
|
|
140
|
+
readonly awaiting_hook: {};
|
|
141
|
+
readonly awaiting_continuation: {};
|
|
142
|
+
readonly completed: {};
|
|
143
|
+
readonly failed: {};
|
|
144
|
+
readonly expired: {};
|
|
145
|
+
};
|
|
146
|
+
}>;
|
|
147
|
+
/**
|
|
148
|
+
* Transition a login session and return the new state
|
|
149
|
+
*
|
|
150
|
+
* Uses XState's transition for a single source of truth - the machine
|
|
151
|
+
* definition determines all valid transitions.
|
|
152
|
+
*/
|
|
153
|
+
export declare function transitionLoginSession(currentState: LoginSessionState, event: LoginSessionEvent, context?: LoginSessionContext): {
|
|
154
|
+
state: LoginSessionState;
|
|
155
|
+
context: Partial<LoginSessionContext>;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Check if a login session can transition with the given event
|
|
159
|
+
*
|
|
160
|
+
* Uses XState's transition - if the state changes, the transition is valid.
|
|
161
|
+
*/
|
|
162
|
+
export declare function canTransition(currentState: LoginSessionState, eventType: LoginSessionEvent["type"], context?: LoginSessionContext): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Helper to transition from a LoginSession object
|
|
165
|
+
*/
|
|
166
|
+
export declare function transitionLoginSessionFromEntity(loginSession: LoginSession, event: LoginSessionEvent): {
|
|
167
|
+
state: LoginSessionState;
|
|
168
|
+
context: Partial<LoginSessionContext>;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Get valid events for a given state
|
|
172
|
+
*/
|
|
173
|
+
export declare function getValidEvents(currentState: LoginSessionState): LoginSessionEventType[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper component to render Hono JSX components in Storybook
|
|
5
|
+
* This takes the already-rendered HTML string from a Hono component
|
|
6
|
+
* and hydrates client-side functionality
|
|
7
|
+
*/
|
|
8
|
+
export declare function HonoJSXWrapper({ html }: {
|
|
9
|
+
html: string;
|
|
10
|
+
}): React.DetailedReactHTMLElement<{
|
|
11
|
+
dangerouslySetInnerHTML: {
|
|
12
|
+
__html: string;
|
|
13
|
+
};
|
|
14
|
+
className: string;
|
|
15
|
+
}, HTMLElement>;
|
|
16
|
+
/**
|
|
17
|
+
* Helper function to render a Hono component to HTML
|
|
18
|
+
* Use this in your stories to convert Hono JSX to HTML before passing to React
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderHonoComponent<T>(Component: (props: T) => any, props: T): string;
|
|
21
|
+
/**
|
|
22
|
+
* Extract body content from a full HTML document
|
|
23
|
+
* This is useful for rendering full-page components (like AuthLayout) in Storybook
|
|
24
|
+
*/
|
|
25
|
+
export declare function extractBodyContent(html: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Wrapper for rendering full HTML documents in Storybook
|
|
28
|
+
* Extracts just the body content to display in the Storybook iframe
|
|
29
|
+
* Uses display:contents to make the wrapper transparent to layout,
|
|
30
|
+
* allowing the inner flex container to work properly
|
|
31
|
+
* Also hydrates client-side functionality like password toggles
|
|
32
|
+
*/
|
|
33
|
+
export declare function HonoFullPageWrapper({ html }: {
|
|
34
|
+
html: string;
|
|
35
|
+
}): React.DetailedReactHTMLElement<{
|
|
36
|
+
dangerouslySetInnerHTML: {
|
|
37
|
+
__html: string;
|
|
38
|
+
};
|
|
39
|
+
className: string;
|
|
40
|
+
style: {
|
|
41
|
+
display: "contents";
|
|
42
|
+
};
|
|
43
|
+
}, HTMLElement>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Context } from "hono";
|
|
2
|
+
import { Connection } from "@authhero/adapter-interfaces";
|
|
3
|
+
import { Bindings, Variables } from "../types";
|
|
4
|
+
export declare const displayName = "Apple";
|
|
5
|
+
export declare const logoDataUri = "data:image/svg+xml,%3Csvg%20width%3D%2245%22%20height%3D%2245%22%20viewBox%3D%220%200%2045%2045%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M45%200H0V45H45V0Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M23.5344%2010.3846C25.5313%2010.3846%2028.0344%209.01144%2029.525%207.18055C30.875%205.5213%2031.8594%203.20407%2031.8594%200.886839C31.8594%200.572154%2031.8313%200.25747%2031.775%200C29.5531%200.0858233%2026.8813%201.51621%2025.2781%203.43293C24.0125%204.89193%2022.8594%207.18055%2022.8594%209.52638C22.8594%209.86968%2022.9156%2010.213%2022.9438%2010.3274C23.0844%2010.356%2023.3094%2010.3846%2023.5344%2010.3846ZM16.5031%2045C19.2313%2045%2020.4406%2043.1405%2023.8438%2043.1405C27.3031%2043.1405%2028.0625%2044.9428%2031.1%2044.9428C34.0813%2044.9428%2036.0781%2042.1392%2037.9625%2039.3929C40.0719%2036.246%2040.9438%2033.1564%2041%2033.0134C40.8031%2032.9561%2035.0938%2030.5817%2035.0938%2023.9161C35.0938%2018.1373%2039.5938%2015.534%2039.8469%2015.3338C36.8656%2010.9854%2032.3375%2010.8709%2031.1%2010.8709C27.7531%2010.8709%2025.025%2012.9307%2023.3094%2012.9307C21.4531%2012.9307%2019.0063%2010.9854%2016.1094%2010.9854C10.5969%2010.9854%205%2015.6198%205%2024.3738C5%2029.8093%207.08125%2035.5594%209.64063%2039.2784C11.8344%2042.4253%2013.7469%2045%2016.5031%2045Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E";
|
|
6
|
+
export declare function getRedirect(ctx: Context<{
|
|
7
|
+
Bindings: Bindings;
|
|
8
|
+
Variables: Variables;
|
|
9
|
+
}>, connection: Connection): Promise<{
|
|
10
|
+
redirectUrl: string;
|
|
11
|
+
code: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function validateAuthorizationCodeAndGetUser(ctx: Context<{
|
|
14
|
+
Bindings: Bindings;
|
|
15
|
+
Variables: Variables;
|
|
16
|
+
}>, connection: Connection, code: string): Promise<{
|
|
17
|
+
sub: string;
|
|
18
|
+
email: string | undefined;
|
|
19
|
+
given_name: string | undefined;
|
|
20
|
+
family_name: string | undefined;
|
|
21
|
+
name: string | undefined;
|
|
22
|
+
picture: unknown;
|
|
23
|
+
locale: unknown;
|
|
24
|
+
}>;
|