authhero 9.4.1 → 9.5.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 (28) hide show
  1. package/dist/assets/u/widget/authhero-widget.esm.js +1 -1
  2. package/dist/assets/u/widget/p-c2744f87.entry.js +1 -0
  3. package/dist/authhero.cjs +144 -144
  4. package/dist/authhero.d.ts +170 -170
  5. package/dist/authhero.mjs +12051 -12057
  6. package/dist/tsconfig.types.tsbuildinfo +1 -1
  7. package/dist/types/authentication-flows/passwordless.d.ts +1 -1
  8. package/dist/types/hooks/formhooks.d.ts +1 -1
  9. package/dist/types/i18n/index.d.ts +8 -0
  10. package/dist/types/index.d.ts +170 -170
  11. package/dist/types/routes/auth-api/index.d.ts +22 -22
  12. package/dist/types/routes/auth-api/passwordless.d.ts +16 -16
  13. package/dist/types/routes/management-api/branding.d.ts +13 -13
  14. package/dist/types/routes/management-api/connections.d.ts +6 -6
  15. package/dist/types/routes/management-api/email-templates.d.ts +20 -20
  16. package/dist/types/routes/management-api/index.d.ts +220 -220
  17. package/dist/types/routes/management-api/organizations.d.ts +6 -6
  18. package/dist/types/routes/management-api/prompts.d.ts +4 -4
  19. package/dist/types/routes/universal-login/common.d.ts +8 -8
  20. package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
  21. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  22. package/dist/types/routes/universal-login/index.d.ts +4 -4
  23. package/dist/types/routes/universal-login/u2-form-node.d.ts +2 -2
  24. package/dist/types/routes/universal-login/u2-index.d.ts +7 -7
  25. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  26. package/dist/types/utils/locale.d.ts +29 -11
  27. package/package.json +3 -3
  28. package/dist/assets/u/widget/p-b5f14fa6.entry.js +0 -1
@@ -729,19 +729,19 @@ export declare const organizationRoutes: OpenAPIHono<{
729
729
  } & {
730
730
  json: {
731
731
  client_id: string;
732
- invitee: {
733
- email?: string | undefined;
734
- };
735
732
  inviter: {
736
733
  name?: string | undefined;
737
734
  };
735
+ invitee: {
736
+ email?: string | undefined;
737
+ };
738
738
  id?: string | undefined;
739
739
  app_metadata?: Record<string, any> | undefined;
740
740
  user_metadata?: Record<string, any> | undefined;
741
741
  connection_id?: string | undefined;
742
+ ttl_sec?: number | undefined;
742
743
  roles?: string[] | undefined;
743
744
  send_invitation_email?: boolean | undefined;
744
- ttl_sec?: number | undefined;
745
745
  };
746
746
  };
747
747
  output: {
@@ -788,7 +788,7 @@ export declare const organizationRoutes: OpenAPIHono<{
788
788
  };
789
789
  output: {};
790
790
  outputFormat: string;
791
- status: 204;
791
+ status: 404;
792
792
  } | {
793
793
  input: {
794
794
  param: {
@@ -802,7 +802,7 @@ export declare const organizationRoutes: OpenAPIHono<{
802
802
  };
803
803
  output: {};
804
804
  outputFormat: string;
805
- status: 404;
805
+ status: 204;
806
806
  };
807
807
  };
808
808
  } & {
@@ -52,7 +52,7 @@ export declare const promptsRoutes: OpenAPIHono<{
52
52
  };
53
53
  };
54
54
  output: {
55
- prompt: "common" | "status" | "login" | "mfa" | "organizations" | "signup" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
55
+ prompt: "common" | "consent" | "device-flow" | "email-otp-challenge" | "email-verification" | "invitation" | "login" | "login-id" | "login-password" | "login-passwordless" | "mfa" | "mfa-email" | "mfa-otp" | "mfa-phone" | "mfa-login-options" | "mfa-push" | "mfa-recovery-code" | "mfa-voice" | "mfa-webauthn" | "passkeys" | "organizations" | "reset-password" | "signup" | "signup-id" | "signup-password" | "status" | "captcha" | "custom-form";
56
56
  language: string;
57
57
  }[];
58
58
  outputFormat: "json";
@@ -90,7 +90,7 @@ export declare const promptsRoutes: OpenAPIHono<{
90
90
  $get: {
91
91
  input: {
92
92
  param: {
93
- prompt: "common" | "status" | "login" | "mfa" | "organizations" | "signup" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
93
+ prompt: "common" | "consent" | "device-flow" | "email-otp-challenge" | "email-verification" | "invitation" | "login" | "login-id" | "login-password" | "login-passwordless" | "mfa" | "mfa-email" | "mfa-otp" | "mfa-phone" | "mfa-login-options" | "mfa-push" | "mfa-recovery-code" | "mfa-voice" | "mfa-webauthn" | "passkeys" | "organizations" | "reset-password" | "signup" | "signup-id" | "signup-password" | "status" | "captcha" | "custom-form";
94
94
  language: string;
95
95
  };
96
96
  } & {
@@ -112,7 +112,7 @@ export declare const promptsRoutes: OpenAPIHono<{
112
112
  $put: {
113
113
  input: {
114
114
  param: {
115
- prompt: "common" | "status" | "login" | "mfa" | "organizations" | "signup" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
115
+ prompt: "common" | "consent" | "device-flow" | "email-otp-challenge" | "email-verification" | "invitation" | "login" | "login-id" | "login-password" | "login-passwordless" | "mfa" | "mfa-email" | "mfa-otp" | "mfa-phone" | "mfa-login-options" | "mfa-push" | "mfa-recovery-code" | "mfa-voice" | "mfa-webauthn" | "passkeys" | "organizations" | "reset-password" | "signup" | "signup-id" | "signup-password" | "status" | "captcha" | "custom-form";
116
116
  language: string;
117
117
  };
118
118
  } & {
@@ -136,7 +136,7 @@ export declare const promptsRoutes: OpenAPIHono<{
136
136
  $delete: {
137
137
  input: {
138
138
  param: {
139
- prompt: "common" | "status" | "login" | "mfa" | "organizations" | "signup" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
139
+ prompt: "common" | "consent" | "device-flow" | "email-otp-challenge" | "email-verification" | "invitation" | "login" | "login-id" | "login-password" | "login-passwordless" | "mfa" | "mfa-email" | "mfa-otp" | "mfa-phone" | "mfa-login-options" | "mfa-push" | "mfa-recovery-code" | "mfa-voice" | "mfa-webauthn" | "passkeys" | "organizations" | "reset-password" | "signup" | "signup-id" | "signup-password" | "status" | "captcha" | "custom-form";
140
140
  language: string;
141
141
  };
142
142
  } & {
@@ -21,7 +21,7 @@ export declare function initJSXRoute(ctx: Context<{
21
21
  base_focus_color: string;
22
22
  base_hover_color: string;
23
23
  body_text: string;
24
- captcha_widget_theme: "auto" | "light" | "dark";
24
+ captcha_widget_theme: "dark" | "light" | "auto";
25
25
  error: string;
26
26
  header: string;
27
27
  icons: string;
@@ -72,7 +72,7 @@ export declare function initJSXRoute(ctx: Context<{
72
72
  background_color: string;
73
73
  background_image_url: string;
74
74
  page_layout: "center" | "left" | "right";
75
- logo_placement?: "widget" | "chip" | "none" | undefined;
75
+ logo_placement?: "none" | "widget" | "chip" | undefined;
76
76
  };
77
77
  widget: {
78
78
  header_text_alignment: "center" | "left" | "right";
@@ -99,7 +99,7 @@ export declare function initJSXRoute(ctx: Context<{
99
99
  font?: {
100
100
  url: string;
101
101
  } | undefined;
102
- dark_mode?: "auto" | "light" | "dark" | undefined;
102
+ dark_mode?: "dark" | "light" | "auto" | undefined;
103
103
  } | null;
104
104
  client: {
105
105
  created_at: string;
@@ -408,7 +408,7 @@ export declare function initJSXRoute(ctx: Context<{
408
408
  } | undefined;
409
409
  } | undefined;
410
410
  passkey_options?: {
411
- challenge_ui?: "button" | "both" | "autofill" | undefined;
411
+ challenge_ui?: "both" | "autofill" | "button" | undefined;
412
412
  local_enrollment_enabled?: boolean | undefined;
413
413
  progressive_enrollment_enabled?: boolean | undefined;
414
414
  } | undefined;
@@ -754,7 +754,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
754
754
  base_focus_color: string;
755
755
  base_hover_color: string;
756
756
  body_text: string;
757
- captcha_widget_theme: "auto" | "light" | "dark";
757
+ captcha_widget_theme: "dark" | "light" | "auto";
758
758
  error: string;
759
759
  header: string;
760
760
  icons: string;
@@ -805,7 +805,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
805
805
  background_color: string;
806
806
  background_image_url: string;
807
807
  page_layout: "center" | "left" | "right";
808
- logo_placement?: "widget" | "chip" | "none" | undefined;
808
+ logo_placement?: "none" | "widget" | "chip" | undefined;
809
809
  };
810
810
  widget: {
811
811
  header_text_alignment: "center" | "left" | "right";
@@ -832,7 +832,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
832
832
  font?: {
833
833
  url: string;
834
834
  } | undefined;
835
- dark_mode?: "auto" | "light" | "dark" | undefined;
835
+ dark_mode?: "dark" | "light" | "auto" | undefined;
836
836
  } | null;
837
837
  client: {
838
838
  created_at: string;
@@ -1141,7 +1141,7 @@ export declare function initJSXRouteWithSession(ctx: Context<{
1141
1141
  } | undefined;
1142
1142
  } | undefined;
1143
1143
  passkey_options?: {
1144
- challenge_ui?: "button" | "both" | "autofill" | undefined;
1144
+ challenge_ui?: "both" | "autofill" | "button" | undefined;
1145
1145
  local_enrollment_enabled?: boolean | undefined;
1146
1146
  progressive_enrollment_enabled?: boolean | undefined;
1147
1147
  } | undefined;
@@ -27,7 +27,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
27
27
  output: {
28
28
  screen: {
29
29
  action: string;
30
- method: "POST" | "GET";
30
+ method: "GET" | "POST";
31
31
  components: {
32
32
  id: string;
33
33
  type: string;
@@ -43,7 +43,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
43
43
  hint?: string | undefined;
44
44
  messages?: {
45
45
  text: string;
46
- type: "error" | "success" | "info" | "warning";
46
+ type: "success" | "error" | "info" | "warning";
47
47
  id?: number | undefined;
48
48
  }[] | undefined;
49
49
  }[];
@@ -51,7 +51,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
51
51
  description?: string | undefined;
52
52
  messages?: {
53
53
  text: string;
54
- type: "error" | "success" | "info" | "warning";
54
+ type: "success" | "error" | "info" | "warning";
55
55
  id?: number | undefined;
56
56
  }[] | undefined;
57
57
  links?: {
@@ -107,7 +107,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
107
107
  output: {
108
108
  screen: {
109
109
  action: string;
110
- method: "POST" | "GET";
110
+ method: "GET" | "POST";
111
111
  components: {
112
112
  id: string;
113
113
  type: string;
@@ -123,7 +123,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
123
123
  hint?: string | undefined;
124
124
  messages?: {
125
125
  text: string;
126
- type: "error" | "success" | "info" | "warning";
126
+ type: "success" | "error" | "info" | "warning";
127
127
  id?: number | undefined;
128
128
  }[] | undefined;
129
129
  }[];
@@ -131,7 +131,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
131
131
  description?: string | undefined;
132
132
  messages?: {
133
133
  text: string;
134
- type: "error" | "success" | "info" | "warning";
134
+ type: "success" | "error" | "info" | "warning";
135
135
  id?: number | undefined;
136
136
  }[] | undefined;
137
137
  links?: {
@@ -204,7 +204,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
204
204
  output: {
205
205
  screen: {
206
206
  action: string;
207
- method: "POST" | "GET";
207
+ method: "GET" | "POST";
208
208
  components: {
209
209
  id: string;
210
210
  type: string;
@@ -220,7 +220,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
220
220
  hint?: string | undefined;
221
221
  messages?: {
222
222
  text: string;
223
- type: "error" | "success" | "info" | "warning";
223
+ type: "success" | "error" | "info" | "warning";
224
224
  id?: number | undefined;
225
225
  }[] | undefined;
226
226
  }[];
@@ -228,7 +228,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
228
228
  description?: string | undefined;
229
229
  messages?: {
230
230
  text: string;
231
- type: "error" | "success" | "info" | "warning";
231
+ type: "success" | "error" | "info" | "warning";
232
232
  id?: number | undefined;
233
233
  }[] | undefined;
234
234
  links?: {
@@ -319,7 +319,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
319
319
  output: {
320
320
  screen: {
321
321
  action: string;
322
- method: "POST" | "GET";
322
+ method: "GET" | "POST";
323
323
  components: {
324
324
  id: string;
325
325
  type: string;
@@ -335,7 +335,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
335
335
  hint?: string | undefined;
336
336
  messages?: {
337
337
  text: string;
338
- type: "error" | "success" | "info" | "warning";
338
+ type: "success" | "error" | "info" | "warning";
339
339
  id?: number | undefined;
340
340
  }[] | undefined;
341
341
  }[];
@@ -343,7 +343,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
343
343
  description?: string | undefined;
344
344
  messages?: {
345
345
  text: string;
346
- type: "error" | "success" | "info" | "warning";
346
+ type: "success" | "error" | "info" | "warning";
347
347
  id?: number | undefined;
348
348
  }[] | undefined;
349
349
  links?: {
@@ -30,7 +30,7 @@ export declare const identifierRoutes: OpenAPIHono<{
30
30
  } & {
31
31
  form: {
32
32
  username: string;
33
- login_selection?: "password" | "code" | undefined;
33
+ login_selection?: "code" | "password" | undefined;
34
34
  };
35
35
  };
36
36
  output: {};
@@ -44,7 +44,7 @@ export declare const identifierRoutes: OpenAPIHono<{
44
44
  } & {
45
45
  form: {
46
46
  username: string;
47
- login_selection?: "password" | "code" | undefined;
47
+ login_selection?: "code" | "password" | undefined;
48
48
  };
49
49
  };
50
50
  output: {};
@@ -63,7 +63,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
63
63
  };
64
64
  output: {};
65
65
  outputFormat: string;
66
- status: 200;
66
+ status: 404;
67
67
  } | {
68
68
  input: {
69
69
  param: {
@@ -77,7 +77,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
77
77
  };
78
78
  output: {};
79
79
  outputFormat: string;
80
- status: 404;
80
+ status: 200;
81
81
  };
82
82
  };
83
83
  } & {
@@ -97,7 +97,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
97
97
  };
98
98
  output: {};
99
99
  outputFormat: string;
100
- status: 200;
100
+ status: 404;
101
101
  } | {
102
102
  input: {
103
103
  param: {
@@ -113,7 +113,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
113
113
  };
114
114
  output: {};
115
115
  outputFormat: string;
116
- status: 404;
116
+ status: 200;
117
117
  };
118
118
  };
119
119
  }, "/forms"> & import("hono/types").MergeSchemaPath<{
@@ -28,7 +28,7 @@ export declare const u2FormNodeRoutes: OpenAPIHono<{
28
28
  };
29
29
  output: {};
30
30
  outputFormat: string;
31
- status: 200;
31
+ status: 404;
32
32
  } | {
33
33
  input: {
34
34
  param: {
@@ -42,7 +42,7 @@ export declare const u2FormNodeRoutes: OpenAPIHono<{
42
42
  };
43
43
  output: {};
44
44
  outputFormat: string;
45
- status: 404;
45
+ status: 200;
46
46
  };
47
47
  };
48
48
  } & {
@@ -165,7 +165,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
165
165
  $get: {
166
166
  input: {
167
167
  param: {
168
- screen: "impersonate" | "account" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "try-connection-result" | "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";
168
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "account" | "try-connection-result" | "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";
169
169
  };
170
170
  } & {
171
171
  query: {
@@ -181,7 +181,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
181
181
  } | {
182
182
  input: {
183
183
  param: {
184
- screen: "impersonate" | "account" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "try-connection-result" | "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";
184
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "account" | "try-connection-result" | "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";
185
185
  };
186
186
  } & {
187
187
  query: {
@@ -197,7 +197,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
197
197
  } | {
198
198
  input: {
199
199
  param: {
200
- screen: "impersonate" | "account" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "try-connection-result" | "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";
200
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "account" | "try-connection-result" | "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";
201
201
  };
202
202
  } & {
203
203
  query: {
@@ -217,7 +217,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
217
217
  $post: {
218
218
  input: {
219
219
  param: {
220
- screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "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";
220
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "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";
221
221
  };
222
222
  } & {
223
223
  query: {
@@ -235,7 +235,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
235
235
  } | {
236
236
  input: {
237
237
  param: {
238
- screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "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";
238
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "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";
239
239
  };
240
240
  } & {
241
241
  query: {
@@ -267,7 +267,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
267
267
  };
268
268
  output: {};
269
269
  outputFormat: string;
270
- status: 200;
270
+ status: 404;
271
271
  } | {
272
272
  input: {
273
273
  param: {
@@ -281,7 +281,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
281
281
  };
282
282
  output: {};
283
283
  outputFormat: string;
284
- status: 404;
284
+ status: 200;
285
285
  };
286
286
  };
287
287
  } & {
@@ -170,7 +170,7 @@ export declare const u2Routes: OpenAPIHono<{
170
170
  $get: {
171
171
  input: {
172
172
  param: {
173
- screen: "impersonate" | "account" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "try-connection-result" | "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";
173
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "account" | "try-connection-result" | "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";
174
174
  };
175
175
  } & {
176
176
  query: {
@@ -186,7 +186,7 @@ export declare const u2Routes: OpenAPIHono<{
186
186
  } | {
187
187
  input: {
188
188
  param: {
189
- screen: "impersonate" | "account" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "try-connection-result" | "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";
189
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "account" | "try-connection-result" | "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";
190
190
  };
191
191
  } & {
192
192
  query: {
@@ -202,7 +202,7 @@ export declare const u2Routes: OpenAPIHono<{
202
202
  } | {
203
203
  input: {
204
204
  param: {
205
- screen: "impersonate" | "account" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "try-connection-result" | "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";
205
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "account" | "try-connection-result" | "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";
206
206
  };
207
207
  } & {
208
208
  query: {
@@ -222,7 +222,7 @@ export declare const u2Routes: OpenAPIHono<{
222
222
  $post: {
223
223
  input: {
224
224
  param: {
225
- screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "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";
225
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "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";
226
226
  };
227
227
  } & {
228
228
  query: {
@@ -240,7 +240,7 @@ export declare const u2Routes: OpenAPIHono<{
240
240
  } | {
241
241
  input: {
242
242
  param: {
243
- screen: "impersonate" | "login" | "signup" | "reset-password" | "consent" | "enter-password" | "reset-password/request" | "reset-password/code" | "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";
243
+ screen: "consent" | "login" | "reset-password" | "signup" | "enter-password" | "impersonate" | "reset-password/request" | "reset-password/code" | "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";
244
244
  };
245
245
  } & {
246
246
  query: {
@@ -1,20 +1,38 @@
1
1
  /**
2
- * Locale resolution for the universal login pages.
2
+ * Locale and language resolution for the universal login pages and emails.
3
3
  *
4
- * This is deliberately separate from the `detectLanguage` helpers used to pick
5
- * translations: those reduce a tag to its language subtag ("en-GB" -> "en"),
6
- * which is the right key for a translation catalogue but throws away the
7
- * region — and the region is what decides whether a date reads DD/MM/YYYY or
8
- * MM/DD/YYYY. This keeps the full tag for formatting decisions.
4
+ * Two related but distinct outputs:
5
+ *
6
+ * - `resolveLanguage` reduces to a language subtag ("en-GB" -> "en"), which is
7
+ * the right key for a translation catalogue.
8
+ * - `resolveLocale` keeps the full tag the region is what decides whether a
9
+ * date reads DD/MM/YYYY or MM/DD/YYYY.
10
+ *
11
+ * Both honour the tenant's `enabled_locales` the way Auth0 does: when set it
12
+ * is both a restriction (requested languages outside the list are ignored)
13
+ * and a default (its first entry wins when nothing requested matches).
9
14
  */
10
15
  /**
11
16
  * Resolve the locale used for formatting, keeping the region subtag.
12
17
  *
13
- * Priority mirrors `detectLanguage`: the OAuth request's `ui_locales` (which
14
- * the application sets explicitly, and is therefore the closest thing to a
15
- * per-tenant choice today) wins over the browser's `Accept-Language`.
18
+ * Priority: the OAuth request's `ui_locales` (which the application sets
19
+ * explicitly) wins over the browser's `Accept-Language`. When the tenant
20
+ * restricts languages via `enabled_locales`, candidates outside the list are
21
+ * skipped and the first enabled locale is the fallback instead of "en".
22
+ */
23
+ export declare function resolveLocale(uiLocales: string | undefined, acceptLanguage: string | undefined, enabledLocales?: string[]): string;
24
+ /**
25
+ * Resolve the language used to pick translations: the language subtag of the
26
+ * same tag `resolveLocale` would choose.
27
+ */
28
+ export declare function resolveLanguage(uiLocales: string | undefined, acceptLanguage: string | undefined, enabledLocales?: string[]): string;
29
+ /**
30
+ * Resolve a single already-chosen language (e.g. one threaded into an email
31
+ * sender) against the tenant's `enabled_locales`: keep it when it is enabled
32
+ * (or no restriction is configured), otherwise fall back to the tenant's
33
+ * first enabled locale. Always returns a language subtag.
16
34
  */
17
- export declare function resolveLocale(uiLocales: string | undefined, acceptLanguage: string | undefined): string;
35
+ export declare function resolveTenantLanguage(language: string | undefined, enabledLocales?: string[]): string;
18
36
  /**
19
37
  * Resolve the locale from a Hono context, using the request's
20
38
  * `Accept-Language` header and an optional explicit `ui_locales`.
@@ -23,4 +41,4 @@ export declare function resolveLocaleFromContext(ctx: {
23
41
  req: {
24
42
  header: (name: string) => string | undefined;
25
43
  };
26
- }, uiLocales?: string): string;
44
+ }, uiLocales?: string, enabledLocales?: string[]): string;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "9.4.1",
14
+ "version": "9.5.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -64,7 +64,7 @@
64
64
  "vite-plugin-dts": "^4.5.4",
65
65
  "vitest": "^4.1.7",
66
66
  "@authhero/kysely-adapter": "12.3.1",
67
- "@authhero/widget": "0.38.0"
67
+ "@authhero/widget": "0.38.1"
68
68
  },
69
69
  "dependencies": {
70
70
  "@peculiar/x509": "^1.14.0",
@@ -80,8 +80,8 @@
80
80
  "qrcode": "^1.5.4",
81
81
  "sanitize-html": "^2.17.4",
82
82
  "xstate": "^5.31.1",
83
- "@authhero/adapter-interfaces": "4.7.0",
84
83
  "@authhero/proxy": "0.10.4",
84
+ "@authhero/adapter-interfaces": "4.7.0",
85
85
  "@authhero/saml": "0.5.4"
86
86
  },
87
87
  "peerDependencies": {