authhero 9.39.0 → 9.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/assets/u/widget/authhero-widget.esm.js +1 -1
  2. package/dist/assets/u/widget/index.esm.js +1 -1
  3. package/dist/assets/u/widget/p-603aa8fa.entry.js +1 -0
  4. package/dist/assets/u/widget/p-6774edd2.entry.js +1 -0
  5. package/dist/authhero.cjs +173 -168
  6. package/dist/authhero.d.ts +717 -611
  7. package/dist/authhero.mjs +14301 -12851
  8. package/dist/{mfa-DMThiuUR.mjs → mfa-CdC-9ysu.mjs} +89 -89
  9. package/dist/{mfa-Dh6nNiRX.js → mfa-Dx8-AJ6U.js} +2 -2
  10. package/dist/mfa-attempts-CtWWceg2.js +393 -0
  11. package/dist/{mfa-attempts-O0x4jJzl.mjs → mfa-attempts-mBkfX0wf.mjs} +7055 -6373
  12. package/dist/{passkey-enrollment-CSeOQWv1.js → passkey-enrollment-KQcVF_QM.js} +1 -1
  13. package/dist/tsconfig.types.tsbuildinfo +1 -1
  14. package/dist/types/authentication-flows/common.d.ts +4 -1
  15. package/dist/types/authentication-flows/mfa-attempts.d.ts +7 -0
  16. package/dist/types/generated/locale-types.d.ts +45 -0
  17. package/dist/types/helpers/client.d.ts +1 -0
  18. package/dist/types/helpers/code-recipient.d.ts +37 -0
  19. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  20. package/dist/types/hooks/codehooks.d.ts +45 -0
  21. package/dist/types/hooks/helpers/action-users.d.ts +56 -0
  22. package/dist/types/hooks/helpers/post-login-account-linking.d.ts +18 -4
  23. package/dist/types/hooks/lifecycle-codehooks.d.ts +2 -2
  24. package/dist/types/hooks/pre-screen.d.ts +114 -0
  25. package/dist/types/index.d.ts +409 -363
  26. package/dist/types/routes/auth-api/index.d.ts +20 -20
  27. package/dist/types/routes/auth-api/passwordless.d.ts +14 -14
  28. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  29. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  30. package/dist/types/routes/management-api/action-triggers.d.ts +28 -28
  31. package/dist/types/routes/management-api/actions.d.ts +13 -13
  32. package/dist/types/routes/management-api/branding-uploads.d.ts +4 -4
  33. package/dist/types/routes/management-api/branding.d.ts +9 -9
  34. package/dist/types/routes/management-api/client-registration-tokens.d.ts +3 -3
  35. package/dist/types/routes/management-api/clients.d.ts +20 -18
  36. package/dist/types/routes/management-api/connections.d.ts +15 -9
  37. package/dist/types/routes/management-api/emails.d.ts +6 -6
  38. package/dist/types/routes/management-api/failed-events.d.ts +4 -4
  39. package/dist/types/routes/management-api/forms.d.ts +168 -144
  40. package/dist/types/routes/management-api/guardian.d.ts +1 -1
  41. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  42. package/dist/types/routes/management-api/hooks.d.ts +49 -49
  43. package/dist/types/routes/management-api/index.d.ts +370 -338
  44. package/dist/types/routes/management-api/jobs.d.ts +2 -2
  45. package/dist/types/routes/management-api/keys.d.ts +4 -4
  46. package/dist/types/routes/management-api/log-streams.d.ts +6 -6
  47. package/dist/types/routes/management-api/logs.d.ts +4 -4
  48. package/dist/types/routes/management-api/organizations.d.ts +2 -2
  49. package/dist/types/routes/management-api/prompts.d.ts +8 -8
  50. package/dist/types/routes/management-api/resource-servers.d.ts +8 -8
  51. package/dist/types/routes/management-api/roles.d.ts +1 -1
  52. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  53. package/dist/types/routes/management-api/self-service-profiles.d.ts +1 -1
  54. package/dist/types/routes/management-api/tenant-members.d.ts +8 -8
  55. package/dist/types/routes/management-api/tenant-operations.d.ts +4 -4
  56. package/dist/types/routes/management-api/tenants.d.ts +20 -20
  57. package/dist/types/routes/management-api/users.d.ts +12 -12
  58. package/dist/types/routes/universal-login/common.d.ts +6 -6
  59. package/dist/types/routes/universal-login/flow-api.d.ts +8 -8
  60. package/dist/types/routes/universal-login/pre-screen-gates.d.ts +31 -0
  61. package/dist/types/routes/universal-login/screens/account-change-email.d.ts +52 -0
  62. package/dist/types/routes/universal-login/screens/account-helpers.d.ts +19 -24
  63. package/dist/types/routes/universal-login/screens/account.d.ts +6 -0
  64. package/dist/types/routes/universal-login/screens/index.d.ts +4 -2
  65. package/dist/types/routes/universal-login/screens/invalid-session.d.ts +10 -0
  66. package/dist/types/routes/universal-login/screens/login-otp.d.ts +81 -7
  67. package/dist/types/routes/universal-login/screens/magic-link-sent.d.ts +8 -1
  68. package/dist/types/routes/universal-login/screens/signup.d.ts +0 -3
  69. package/dist/types/routes/universal-login/screens/social-connections.d.ts +31 -0
  70. package/dist/types/routes/universal-login/screens/types.d.ts +3 -0
  71. package/dist/types/routes/universal-login/u2-index.d.ts +19 -5
  72. package/dist/types/routes/universal-login/u2-routes.d.ts +6 -5
  73. package/dist/types/routes/universal-login/u2-widget-page.d.ts +1 -4
  74. package/dist/types/state-machines/login-session-data.d.ts +36 -1
  75. package/dist/types/state-machines/login-session.d.ts +29 -1
  76. package/dist/types/types/Hooks.d.ts +62 -17
  77. package/dist/types/types/Variables.d.ts +2 -0
  78. package/dist/types/utils/embedded-browser.d.ts +4 -0
  79. package/package.json +6 -6
  80. package/dist/assets/u/widget/p-32247347.entry.js +0 -1
  81. package/dist/assets/u/widget/p-3f908508.entry.js +0 -1
  82. package/dist/mfa-attempts-BaKbuGvZ.js +0 -321
@@ -2,16 +2,90 @@ import type { Context } from "hono";
2
2
  import type { LoginSession } from "@authhero/adapter-interfaces";
3
3
  import type { EnrichedClient } from "../../../helpers/client";
4
4
  import type { Bindings, Variables } from "../../../types";
5
- /**
6
- * Create a one-time code bound to the login session and deliver it to the
7
- * user, either as a code or (for magic-link email connections) as a link.
8
- */
9
- export declare function sendLoginOtp(ctx: Context<{
5
+ import type { ScreenContext, ScreenFactory, ScreenResult } from "./types";
6
+ type OtpContext = Context<{
10
7
  Bindings: Bindings;
11
8
  Variables: Variables;
12
- }>, { client, loginSession, to, magicLink, }: {
9
+ }>;
10
+ /**
11
+ * Login OTP codes or magic links (identifier step plus resends) delivered per
12
+ * login session. Further requests are accepted but nothing is sent.
13
+ *
14
+ * Reserved atomically (see reserveLoginSessionCounter), so concurrent requests
15
+ * on one session cannot exceed it on adapters that implement
16
+ * `updateIfStateDataUnchanged`; other adapters fall back to a best-effort
17
+ * read/modify/write. The optional per-recipient rate limit adds a bound
18
+ * across sessions, but it is not configured by default and fails open on
19
+ * adapter errors, so it is not a hard guarantee.
20
+ */
21
+ export declare const LOGIN_OTP_MAX_SENDS = 5;
22
+ /**
23
+ * Count a login OTP delivery on the login session and consume the optional
24
+ * per-recipient rate limit. Returns false when either limit is reached, or
25
+ * when the session is already finalized; callers then skip delivery but
26
+ * respond as usual, so the response does not reveal the limit or whether
27
+ * the address exists. Counted before sending, so failed sends count too.
28
+ *
29
+ * Order: check the session cap without writing, then the recipient rate
30
+ * limit, then reserve the slot atomically. A request the rate limit rejects
31
+ * does not use up the session's allowance, and a session already at its cap
32
+ * does not consume the recipient's rate limit. Concurrent requests may all
33
+ * pass the first check, but only LOGIN_OTP_MAX_SENDS of them can reserve.
34
+ */
35
+ export declare function allowLoginOtpSend(ctx: OtpContext, { tenantId, loginSessionId, to, }: {
36
+ tenantId: string;
37
+ loginSessionId: string;
38
+ to: string;
39
+ }): Promise<boolean>;
40
+ /**
41
+ * Create a one-time code bound to the login session and to `to`, and deliver
42
+ * it to the user, either as a code or (for magic-link email connections) as a link.
43
+ *
44
+ * Subject to the per-session send cap and per-recipient rate limit in
45
+ * allowLoginOtpSend; returns false, without sending, when a limit is hit.
46
+ */
47
+ export declare function sendLoginOtp(ctx: OtpContext, { client, loginSession, to, magicLink, }: {
13
48
  client: EnrichedClient;
14
49
  loginSession: LoginSession;
15
50
  to: string;
16
51
  magicLink: boolean;
17
- }): Promise<void>;
52
+ }): Promise<boolean>;
53
+ /**
54
+ * Re-send the login OTP (code or magic link) for the login session behind
55
+ * `state`, to the username the identifier step stored on it.
56
+ *
57
+ * Only re-sends when a login OTP was issued for this session to the same
58
+ * recipient before. The enumeration-safe stub path in the identifier screens
59
+ * shows the challenge without issuing a code, and a resend must not start
60
+ * delivering to an unknown address either, nor to a new address the session
61
+ * switched to after a code went to an earlier one. Repeated resends are capped by allowLoginOtpSend;
62
+ * past the cap the caller still shows the usual "code sent" message.
63
+ *
64
+ * Returns false when the login session is gone or has no username.
65
+ */
66
+ export declare function resendLoginOtp(ctx: OtpContext, { client, state, magicLink, }: {
67
+ client: EnrichedClient;
68
+ state: string;
69
+ magicLink: boolean;
70
+ }): Promise<boolean>;
71
+ /**
72
+ * POST handler body for the RESEND_BUTTON on the login OTP screens
73
+ * (email-otp-challenge, sms-otp-challenge, magic-link-sent): re-send and
74
+ * re-render the screen with a success or error message. A delivery error is
75
+ * shown as such, except in enumeration-safe mode
76
+ * (client.hide_sign_up_disabled_error), where it gets the usual success
77
+ * message like every other resend.
78
+ */
79
+ export declare function loginOtpResendResult(context: ScreenContext, { render, magicLink, successText, failedText, expiredText, }: {
80
+ render: ScreenFactory;
81
+ magicLink: boolean;
82
+ successText: string;
83
+ failedText: string;
84
+ expiredText: string;
85
+ }): Promise<{
86
+ screen: ScreenResult;
87
+ } | {
88
+ error: string;
89
+ screen: ScreenResult;
90
+ }>;
91
+ export {};
@@ -3,9 +3,16 @@
3
3
  *
4
4
  * Shown after a magic link has been sent to the user's email.
5
5
  * Tells the user to check their email and click the link to log in.
6
+ *
7
+ * Corresponds to: /u2/login/magic-link-sent
6
8
  */
7
- import type { ScreenContext, ScreenResult } from "./types";
9
+ import type { ScreenContext, ScreenResult, ScreenDefinition } from "./types";
8
10
  /**
9
11
  * Create the magic-link-sent screen
10
12
  */
11
13
  export declare function magicLinkSentScreen(context: ScreenContext): Promise<ScreenResult>;
14
+ /**
15
+ * Screen definition for the magic-link-sent screen. The only action is the
16
+ * resend button; any other POST re-renders the screen.
17
+ */
18
+ export declare const magicLinkSentScreenDefinition: ScreenDefinition;
@@ -56,8 +56,5 @@ export declare function localizePasswordPolicyError(error: unknown, locale: stri
56
56
  * Create the signup screen
57
57
  */
58
58
  export declare function signupScreen(context: ScreenContext): Promise<ScreenResult>;
59
- /**
60
- * Screen definition for the signup screen
61
- */
62
59
  export declare const signupScreenDefinition: ScreenDefinition;
63
60
  export {};
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Which of a client's connections the u2 login screens show as social /
3
+ * enterprise buttons. Same rules as the legacy /u identifier page:
4
+ *
5
+ * - Email, SMS and database connections are form inputs, not buttons.
6
+ * - `show_as_button: false` always hides a connection.
7
+ * - Connections with `domain_aliases` are reached by home realm discovery
8
+ * (email-domain routing) and hidden unless `show_as_button: true`, on
9
+ * screens that do that routing (the identifier screen).
10
+ * - Strategies that refuse embedded browsers (Google) are hidden in in-app
11
+ * browsers, where the provider would reject the sign-in.
12
+ *
13
+ * Unlike /u, strategies without a built-in handler (custom OAuth2/OIDC set up
14
+ * through the `STRATEGIES` env) are kept: they fall back to their name and a
15
+ * generic icon.
16
+ */
17
+ import type { Connection } from "@authhero/adapter-interfaces";
18
+ export declare function isFormConnection(connection: Connection): boolean;
19
+ export declare function isShownAsButton(connection: Connection, options: {
20
+ embeddedBrowser: boolean;
21
+ hideHrdConnections?: boolean;
22
+ }): boolean;
23
+ /** The connections to render as social / enterprise buttons, in client order. */
24
+ export declare function getButtonConnections(connections: Connection[], userAgent: string | undefined, options?: {
25
+ /**
26
+ * Hide HRD connections (default). Only screens whose submit routes the
27
+ * identifier by email domain may hide them; elsewhere the button is the
28
+ * connection's only way in.
29
+ */
30
+ hideHrdConnections?: boolean;
31
+ }): Connection[];
@@ -160,6 +160,9 @@ export interface ScreenDefinition {
160
160
  /** The screen handler */
161
161
  handler: ScreenHandler;
162
162
  }
163
+ export declare function screenUsesUrlCode(screenId: string): boolean;
164
+ /** `&code=…` for the form action of a screen that carries a URL code. */
165
+ export declare function urlCodeSuffix(screenId: string, code: string | undefined): string;
163
166
  /**
164
167
  * Get the correct login path based on the tenant's identifier_first setting.
165
168
  * Returns "/u2/login" for password-first or "/u2/login/identifier" for identifier-first.
@@ -195,7 +195,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
195
195
  $get: {
196
196
  input: {
197
197
  param: {
198
- screen: "impersonate" | "signup" | "reset-password" | "account" | "consent" | "login" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
198
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "account" | "invalid-session" | "consent" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
199
199
  };
200
200
  } & {
201
201
  query: {
@@ -211,7 +211,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
211
211
  } | {
212
212
  input: {
213
213
  param: {
214
- screen: "impersonate" | "signup" | "reset-password" | "account" | "consent" | "login" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
214
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "account" | "invalid-session" | "consent" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
215
215
  };
216
216
  } & {
217
217
  query: {
@@ -227,7 +227,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
227
227
  } | {
228
228
  input: {
229
229
  param: {
230
- screen: "impersonate" | "signup" | "reset-password" | "account" | "consent" | "login" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
230
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "account" | "invalid-session" | "consent" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
231
231
  };
232
232
  } & {
233
233
  query: {
@@ -247,7 +247,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
247
247
  $post: {
248
248
  input: {
249
249
  param: {
250
- screen: "impersonate" | "signup" | "reset-password" | "consent" | "login" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
250
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
251
251
  };
252
252
  } & {
253
253
  query: {
@@ -265,7 +265,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
265
265
  } | {
266
266
  input: {
267
267
  param: {
268
- screen: "impersonate" | "signup" | "reset-password" | "consent" | "login" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
268
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
269
269
  };
270
270
  } & {
271
271
  query: {
@@ -283,6 +283,20 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
283
283
  };
284
284
  };
285
285
  }, "/"> & import("hono/types").MergeSchemaPath<{
286
+ "/": {
287
+ $get: {
288
+ input: {
289
+ query: {
290
+ error?: string | undefined;
291
+ error_description?: string | undefined;
292
+ };
293
+ };
294
+ output: {};
295
+ outputFormat: string;
296
+ status: 200;
297
+ };
298
+ };
299
+ }, "/error"> & import("hono/types").MergeSchemaPath<{
286
300
  "/": {
287
301
  $get: {
288
302
  input: {
@@ -8,6 +8,7 @@
8
8
  * - GET /u2/login/identifier - Identifier screen (first screen of login flow)
9
9
  * - GET /u2/login/email-otp-challenge - Email OTP code verification
10
10
  * - GET /u2/login/sms-otp-challenge - SMS OTP code verification
11
+ * - GET /u2/login/magic-link-sent - Check your email for the magic link
11
12
  * - GET /u2/enter-password - Password authentication
12
13
  * - GET /u2/signup - New user registration
13
14
  * - GET /u2/reset-password/request - Password reset request
@@ -200,7 +201,7 @@ export declare const u2Routes: OpenAPIHono<{
200
201
  $get: {
201
202
  input: {
202
203
  param: {
203
- screen: "impersonate" | "signup" | "reset-password" | "account" | "consent" | "login" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
204
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "account" | "invalid-session" | "consent" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
204
205
  };
205
206
  } & {
206
207
  query: {
@@ -216,7 +217,7 @@ export declare const u2Routes: OpenAPIHono<{
216
217
  } | {
217
218
  input: {
218
219
  param: {
219
- screen: "impersonate" | "signup" | "reset-password" | "account" | "consent" | "login" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
220
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "account" | "invalid-session" | "consent" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
220
221
  };
221
222
  } & {
222
223
  query: {
@@ -232,7 +233,7 @@ export declare const u2Routes: OpenAPIHono<{
232
233
  } | {
233
234
  input: {
234
235
  param: {
235
- screen: "impersonate" | "signup" | "reset-password" | "account" | "consent" | "login" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
236
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "account" | "invalid-session" | "consent" | "enter-password" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation" | "device/complete";
236
237
  };
237
238
  } & {
238
239
  query: {
@@ -252,7 +253,7 @@ export declare const u2Routes: OpenAPIHono<{
252
253
  $post: {
253
254
  input: {
254
255
  param: {
255
- screen: "impersonate" | "signup" | "reset-password" | "consent" | "login" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
256
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
256
257
  };
257
258
  } & {
258
259
  query: {
@@ -270,7 +271,7 @@ export declare const u2Routes: OpenAPIHono<{
270
271
  } | {
271
272
  input: {
272
273
  param: {
273
- screen: "impersonate" | "signup" | "reset-password" | "consent" | "login" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
274
+ screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "login/email-verification" | "login/email-verification-sent" | "account/change-email" | "account/change-email/verify" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/magic-link-sent" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant" | "self-service/app" | "device/code" | "device/confirmation";
274
275
  };
275
276
  } & {
276
277
  query: {
@@ -121,10 +121,7 @@ export type WidgetPageProps = {
121
121
  name?: string;
122
122
  };
123
123
  };
124
- /** Detects in-app browsers from the request's User-Agent. */
125
- export declare function detectEmbeddedBrowser(userAgent: string | undefined): {
126
- name?: string;
127
- } | undefined;
124
+ export { detectEmbeddedBrowser } from "../../utils/embedded-browser";
128
125
  /** Localized display names for the language picker, in the given order. */
129
126
  export declare function buildLanguageOptions(availableLanguages?: string[]): LanguageOption[] | undefined;
130
127
  /** The short "Terms & Privacy" label, in the page's language. */
@@ -8,12 +8,47 @@ export type LoginSessionDataEvent = Extract<LoginSessionEvent, {
8
8
  export declare class FinalizedLoginSessionError extends Error {
9
9
  constructor(id: string);
10
10
  }
11
+ /** Completed, failed and expired sessions accept no further context updates. */
12
+ export declare function isFinalizedLoginSession(session: Pick<LoginSession, "state">): boolean;
13
+ /** Thrown when every compare-and-swap round lost to a concurrent write. */
14
+ export declare class LoginSessionContentionError extends Error {
15
+ constructor(id: string);
16
+ }
11
17
  /**
12
18
  * Sole persistence boundary for session context updates. Always reduce against
13
19
  * the latest stored context, never a caller's stale session snapshot. Optional
14
20
  * session fields (e.g. MFA state) are persisted in the same adapter update.
15
- * This is read/modify/write, not a cross-request atomic compare-and-swap.
21
+ *
22
+ * Written with the adapter's `updateIfStateDataUnchanged` when available: if
23
+ * another write landed since the read, the event is re-applied to the newer
24
+ * context. So an update never writes back a stale snapshot, e.g. an older
25
+ * counter value reserved by reserveLoginSessionCounter in the meantime.
26
+ * Adapters without that method fall back to a plain read/modify/write.
16
27
  */
17
28
  export declare function updateLoginSessionData(sessions: LoginSessionsAdapter, tenantId: string, id: string, event: LoginSessionDataEvent, fields?: Omit<Partial<LoginSession>, "state_data">): Promise<boolean>;
29
+ /** Per-session send counters that reserveLoginSessionCounter can cap. */
30
+ export type LoginSessionCounter = "login_otp_sent" | "mfa_sms_sent";
31
+ export type LoginSessionCounterStatus =
32
+ /** The counter was incremented; the caller owns one slot. */
33
+ "reserved"
34
+ /** The counter is already at `max`; nothing was written. */
35
+ | "limit_reached" | "not_found" | "finalized"
36
+ /** Every compare-and-swap attempt lost to a concurrent write. */
37
+ | "contended";
38
+ export interface LoginSessionCounterReservation {
39
+ status: LoginSessionCounterStatus;
40
+ /** The session as last read (before the increment), when it exists. */
41
+ session?: LoginSession;
42
+ }
43
+ /**
44
+ * Atomically reserve one slot of a per-session counter capped at `max`.
45
+ *
46
+ * The increment is written with the adapter's `updateIfStateDataUnchanged`,
47
+ * which only applies while `state_data` still equals what was read; a lost
48
+ * race re-reads and retries. Because the counter only grows, concurrent
49
+ * requests can never reserve more than `max` slots in total. Adapters without
50
+ * that method fall back to a plain update (best effort, not atomic).
51
+ */
52
+ export declare function reserveLoginSessionCounter(sessions: LoginSessionsAdapter, tenantId: string, id: string, counter: LoginSessionCounter, max: number): Promise<LoginSessionCounterReservation>;
18
53
  /** Initialize context through the same machine reducer before inserting it. */
19
54
  export declare function createLoginSessionWithData(sessions: LoginSessionsAdapter, tenantId: string, fields: Omit<LoginSessionInsert, "state_data">, data: Omit<LoginSessionData, "passwordReset">): Promise<LoginSession>;
@@ -11,6 +11,18 @@ export interface MfaRequiredByAction {
11
11
  */
12
12
  allow_remember_browser: boolean;
13
13
  }
14
+ /**
15
+ * Custom claims a post-login action set with `api.accessToken.setCustomClaim`
16
+ * / `api.idToken.setCustomClaim` (issue #1816). Applied to the tokens issued
17
+ * for this login, including the authorization-code exchange, and only for the
18
+ * user the hooks settled on. Refresh-token exchanges don't apply them: they
19
+ * don't re-run post-login actions.
20
+ */
21
+ export interface PostLoginActionClaims {
22
+ user_id: string;
23
+ access_token?: Record<string, unknown>;
24
+ id_token?: Record<string, unknown>;
25
+ }
14
26
  /** Persisted context, grouped by responsibility in types, flat on disk. */
15
27
  export interface LoginSessionData {
16
28
  passwordReset?: PasswordResetFlow;
@@ -21,6 +33,8 @@ export interface LoginSessionData {
21
33
  * already run for this login so the resume after MFA does not run them again.
22
34
  */
23
35
  mfa_required_by_action?: MfaRequiredByAction;
36
+ /** Token claims set by post-login actions, see {@link PostLoginActionClaims}. */
37
+ action_claims?: PostLoginActionClaims;
24
38
  /** Authentication method type that satisfied MFA (e.g. "totp", "phone") */
25
39
  mfa_method?: string;
26
40
  /** When MFA was verified (ISO 8601); copied onto the browser session */
@@ -31,7 +45,21 @@ export interface LoginSessionData {
31
45
  guardian_enrollment?: boolean;
32
46
  mfa_failed_attempts?: number;
33
47
  mfa_sms_sent?: number;
48
+ /** Login OTP codes/links sent (identifier step plus resends), see screens/login-otp.ts */
49
+ login_otp_sent?: number;
34
50
  pending_email_verification?: unknown;
51
+ /** u2 change-email: the address a code was sent to, shown on the verify step */
52
+ pending_email_change?: {
53
+ email: string;
54
+ };
55
+ /**
56
+ * u2 change-email: the address the last change set. The verify step shows
57
+ * the confirmation from it on GET, so it survives a no-JS form post, which
58
+ * redirects instead of rendering the POST result.
59
+ */
60
+ email_change_done?: {
61
+ email: string;
62
+ };
35
63
  hookId?: string;
36
64
  form_values?: Record<string, unknown>;
37
65
  continuationScope?: string[];
@@ -252,7 +280,7 @@ export declare const loginSessionMachine: import("xstate").StateMachine<LoginSes
252
280
  }, {
253
281
  type: "passwordResetRequested";
254
282
  params: unknown;
255
- }, never, "failed" | "pending" | "expired" | "authenticated" | "awaiting_email_verification" | "awaiting_mfa" | "awaiting_consent" | "awaiting_hook" | "awaiting_continuation" | "completed", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
283
+ }, never, "pending" | "authenticated" | "failed" | "expired" | "awaiting_email_verification" | "awaiting_mfa" | "awaiting_consent" | "awaiting_hook" | "awaiting_continuation" | "completed", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
256
284
  id: "loginSession";
257
285
  states: {
258
286
  readonly pending: {};
@@ -1,4 +1,4 @@
1
- import { AuthorizationResponseMode, AuthorizationResponseType, DataAdapters, LinkCandidate, RolePermissionInsert, User } from "@authhero/adapter-interfaces";
1
+ import { AuthorizationResponseMode, AuthorizationResponseType, DataAdapters, LinkCandidate, PreScreenOperation, PreScreenPhase, RolePermissionInsert, User } from "@authhero/adapter-interfaces";
2
2
  import { EnrichedClient } from "../helpers/client";
3
3
  import { Context } from "hono";
4
4
  import { Bindings } from "./Bindings";
@@ -251,20 +251,58 @@ export type OnExecutePostUserDeletion = (event: HookEvent & {
251
251
  user_id: string;
252
252
  }, api: OnExecutePostUserDeletionAPI) => Promise<void>;
253
253
  /**
254
- * Self-service account operations that fire the `pre-account-action` trigger
255
- * (an AuthHero extension; Auth0 has no equivalent). The trigger runs once when
256
- * the user starts the operation, before any form, code or write.
254
+ * The authorization request a universal-login screen belongs to, plus the
255
+ * phase the `pre-screen` trigger runs in. The login session id is not
256
+ * included: it is the key to the transaction, not a request parameter.
257
257
  */
258
- export type AccountActionOperation = "change-email" | "update-profile" | "reset-password" | "enroll-mfa" | "remove-mfa" | "enroll-passkey" | "remove-passkey" | "unlink-identity" | "delete-account";
259
- export type PreAccountActionEvent = {
258
+ export type PreScreenTransaction = {
259
+ /** `render` before the screen is shown, `submit` when it is submitted. */
260
+ phase: PreScreenPhase;
261
+ locale: string;
262
+ client_id?: string;
263
+ redirect_uri?: string;
264
+ requested_scopes: string[];
265
+ response_type?: AuthorizationResponseType;
266
+ response_mode?: AuthorizationResponseMode;
267
+ /** The application's `state` parameter. */
268
+ state?: string;
269
+ audience?: string;
270
+ prompt?: string;
271
+ ui_locales?: string;
272
+ acr_values?: string;
273
+ /** The identifier entered or passed as `login_hint` so far. */
274
+ login_hint?: string;
275
+ /** `screen_hint` from the authorization request. */
276
+ screen_hint?: string;
277
+ };
278
+ /**
279
+ * Event of the `pre-screen` trigger (an AuthHero extension; Auth0 has no
280
+ * pre-login trigger). Fires before a universal-login screen is shown and when
281
+ * it is submitted.
282
+ */
283
+ export type PreScreenEvent = {
260
284
  ctx: Context<{
261
285
  Bindings: Bindings;
262
286
  Variables: Variables;
263
287
  }>;
264
- operation: AccountActionOperation;
288
+ screen: {
289
+ name: string;
290
+ };
291
+ prompt: {
292
+ name: string;
293
+ };
294
+ transaction: PreScreenTransaction;
295
+ /**
296
+ * Submit phase only: the operation the submission performs, e.g.
297
+ * `remove-mfa` for the remove button on `account-security`.
298
+ */
299
+ operation?: PreScreenOperation;
300
+ /** Operation-specific detail, e.g. `{ factor: "totp" }` for `enroll-mfa`. */
301
+ details?: Record<string, string>;
265
302
  /**
266
- * The signed-in user. Undefined only for `reset-password` when the
267
- * identifier entered so far doesn't match a user (or none was entered).
303
+ * The user when known: the signed-in user on account screens, the user the
304
+ * identifier entered so far matches on login and password-reset screens,
305
+ * the authenticated user on MFA and consent screens.
268
306
  */
269
307
  user?: User;
270
308
  /** Connection of the user's primary identity. */
@@ -274,27 +312,31 @@ export type PreAccountActionEvent = {
274
312
  strategy?: string;
275
313
  };
276
314
  client?: EnrichedClient;
315
+ organization?: {
316
+ id: string;
317
+ name: string;
318
+ display_name?: string;
319
+ metadata?: Record<string, unknown>;
320
+ };
277
321
  tenant: {
278
322
  id: string;
279
323
  };
280
324
  request: HookRequest;
281
- /** Operation-specific detail, e.g. `{ factor: "totp" }` for `enroll-mfa`. */
282
- details?: Record<string, string>;
283
325
  };
284
- export type OnExecutePreAccountActionAPI = {
326
+ export type OnExecutePreScreenAPI = {
285
327
  redirect: {
286
- /** Send the user to `url` instead of running the operation here. */
328
+ /** Send the user to `url` instead of showing or submitting the screen. */
287
329
  sendUserTo: (url: string, options?: {
288
330
  query?: Record<string, string>;
289
331
  }) => void;
290
332
  };
291
333
  access: {
292
- /** Stop the operation and show `reason` to the user. */
334
+ /** Stop the screen and show `reason` to the user. */
293
335
  deny: (reason?: string) => void;
294
336
  };
295
337
  token: TokenAPI;
296
338
  };
297
- export type OnExecutePreAccountAction = (event: PreAccountActionEvent, api: OnExecutePreAccountActionAPI) => Promise<void>;
339
+ export type OnExecutePreScreen = (event: PreScreenEvent, api: OnExecutePreScreenAPI) => Promise<void>;
298
340
  export type OnExecuteValidateRegistrationUsernameAPI = {
299
341
  deny: (reason?: string) => void;
300
342
  token: TokenAPI;
@@ -333,8 +375,11 @@ export type Hooks = {
333
375
  onExecutePreUserDeletion?: OnExecutePreUserDeletion;
334
376
  onExecutePostUserDeletion?: OnExecutePostUserDeletion;
335
377
  onExecuteValidateRegistrationUsername?: OnExecuteValidateRegistrationUsername;
336
- /** Called when a user starts a self-service account operation (AuthHero extension) */
337
- onExecutePreAccountAction?: OnExecutePreAccountAction;
378
+ /**
379
+ * Called before a universal-login screen is shown and when it is submitted
380
+ * (AuthHero extension, the `pre-screen` trigger)
381
+ */
382
+ onExecutePreScreen?: OnExecutePreScreen;
338
383
  /** Called when /userinfo endpoint is accessed to add custom claims */
339
384
  onFetchUserInfo?: OnFetchUserInfo;
340
385
  };
@@ -3,6 +3,7 @@ import { CountryCode } from "libphonenumber-js";
3
3
  import { Auth0Client } from "./Auth0Client";
4
4
  import type { PreferState } from "../middlewares/prefer";
5
5
  import type { EmbedLoginContext } from "../routes/universal-login/embed";
6
+ import type { PostLoginActionClaims } from "../state-machines/login-session";
6
7
  export type Variables = {
7
8
  /**
8
9
  * The adapter stack for this request. Read this, not `ctx.env.data`.
@@ -75,6 +76,7 @@ export type Variables = {
75
76
  backgroundPromises?: Promise<void>[];
76
77
  client_authenticated_via_assertion?: boolean;
77
78
  action_execution_id?: string;
79
+ post_login_action_claims?: PostLoginActionClaims;
78
80
  serverTiming?: {
79
81
  name: string;
80
82
  dur: number;
@@ -0,0 +1,4 @@
1
+ /** Detects in-app browsers from the request's User-Agent. */
2
+ export declare function detectEmbeddedBrowser(userAgent: string | undefined): {
3
+ name?: string;
4
+ } | undefined;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/sesamyab/authhero"
13
13
  },
14
- "version": "9.39.0",
14
+ "version": "9.41.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -63,8 +63,8 @@
63
63
  "vite": "^8.0.14",
64
64
  "vite-plugin-dts": "^4.5.4",
65
65
  "vitest": "^4.1.7",
66
- "@authhero/kysely-adapter": "12.24.1",
67
- "@authhero/widget": "0.42.1"
66
+ "@authhero/kysely-adapter": "12.25.0",
67
+ "@authhero/widget": "0.43.1"
68
68
  },
69
69
  "dependencies": {
70
70
  "@peculiar/x509": "^1.14.3",
@@ -82,9 +82,9 @@
82
82
  "qrcode": "^1.5.4",
83
83
  "sanitize-html": "^2.17.4",
84
84
  "xstate": "^5.31.1",
85
- "@authhero/adapter-interfaces": "4.34.0",
86
- "@authhero/proxy": "0.11.21",
87
- "@authhero/saml": "0.6.14"
85
+ "@authhero/adapter-interfaces": "4.36.0",
86
+ "@authhero/proxy": "0.11.23",
87
+ "@authhero/saml": "0.6.16"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "@authhero/widget": ">=0.38.9",