authhero 9.18.0 → 9.20.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.
- package/dist/assets/u/widget/index.esm.js +1 -1
- package/dist/authhero.cjs +185 -173
- package/dist/authhero.d.ts +389 -159
- package/dist/authhero.mjs +19766 -17178
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/email-verification.d.ts +74 -0
- package/dist/types/authentication-flows/password.d.ts +3 -2
- package/dist/types/authentication-flows/passwordless.d.ts +2 -2
- package/dist/types/emails/index.d.ts +27 -1
- package/dist/types/generated/locale-types.d.ts +282 -0
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +2 -2
- package/dist/types/helpers/default-destinations.d.ts +7 -1
- package/dist/types/helpers/http-certificate-issuer.d.ts +55 -0
- package/dist/types/helpers/logging.d.ts +5 -0
- package/dist/types/helpers/outbox-destinations/code-hooks.d.ts +5 -1
- package/dist/types/helpers/outbox-destinations/log-streams.d.ts +3 -0
- package/dist/types/helpers/renew-signing-certificates.d.ts +61 -0
- package/dist/types/helpers/request-data.d.ts +15 -0
- package/dist/types/helpers/reserved-claims.d.ts +2 -2
- package/dist/types/helpers/run-outbox-relay.d.ts +7 -1
- package/dist/types/hooks/codehooks.d.ts +14 -1
- package/dist/types/index.d.ts +211 -155
- package/dist/types/routes/auth-api/index.d.ts +26 -26
- package/dist/types/routes/auth-api/passwordless.d.ts +18 -18
- package/dist/types/routes/auth-api/token.d.ts +10 -10
- package/dist/types/routes/management-api/action-executions.d.ts +2 -2
- package/dist/types/routes/management-api/actions.d.ts +1 -1
- package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
- package/dist/types/routes/management-api/branding.d.ts +1 -1
- package/dist/types/routes/management-api/client-grants.d.ts +9 -9
- package/dist/types/routes/management-api/connections.d.ts +6 -6
- package/dist/types/routes/management-api/email-templates.d.ts +18 -18
- package/dist/types/routes/management-api/failed-events.d.ts +53 -1
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/helpers.d.ts +1 -1
- package/dist/types/routes/management-api/hook-code.d.ts +2 -2
- package/dist/types/routes/management-api/index.d.ts +178 -126
- package/dist/types/routes/management-api/keys.d.ts +8 -8
- package/dist/types/routes/management-api/log-streams.d.ts +6 -6
- package/dist/types/routes/management-api/logs.d.ts +4 -4
- package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
- package/dist/types/routes/management-api/organizations.d.ts +3 -3
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/tenant-operations.d.ts +5 -5
- package/dist/types/routes/management-api/tenants.d.ts +1 -1
- package/dist/types/routes/management-api/themes.d.ts +6 -6
- package/dist/types/routes/management-api/users.d.ts +33 -33
- package/dist/types/routes/universal-login/common.d.ts +4 -4
- package/dist/types/routes/universal-login/error-page.d.ts +9 -2
- package/dist/types/routes/universal-login/flow-api.d.ts +4 -4
- package/dist/types/routes/universal-login/sanitization-utils.d.ts +7 -0
- package/dist/types/routes/universal-login/screen-prompt-map.d.ts +2 -0
- package/dist/types/routes/universal-login/screens/email-verification.d.ts +29 -0
- package/dist/types/routes/universal-login/screens/handler-error.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/reset-password.d.ts +5 -1
- package/dist/types/routes/universal-login/screens/signup.d.ts +6 -0
- package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
- package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
- package/dist/types/state-machines/login-session.d.ts +1 -1
- package/dist/types/types/AuthHeroConfig.d.ts +25 -0
- package/dist/types/types/Bindings.d.ts +8 -1
- package/dist/types/types/Variables.d.ts +18 -1
- package/package.json +6 -6
|
@@ -818,14 +818,10 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
818
818
|
};
|
|
819
819
|
output: {
|
|
820
820
|
user_id: string;
|
|
821
|
-
client_id: string;
|
|
822
|
-
created_at: string;
|
|
823
821
|
id: string;
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
}[];
|
|
828
|
-
login_id: string;
|
|
822
|
+
created_at: string;
|
|
823
|
+
client_id: string;
|
|
824
|
+
rotating: boolean;
|
|
829
825
|
device: {
|
|
830
826
|
initial_user_agent: string;
|
|
831
827
|
initial_ip: string;
|
|
@@ -834,9 +830,12 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
834
830
|
last_ip: string;
|
|
835
831
|
last_asn: string;
|
|
836
832
|
};
|
|
837
|
-
|
|
833
|
+
login_id: string;
|
|
834
|
+
resource_servers: {
|
|
835
|
+
audience: string;
|
|
836
|
+
scopes: string;
|
|
837
|
+
}[];
|
|
838
838
|
expires_at?: string | undefined;
|
|
839
|
-
organization?: string | undefined;
|
|
840
839
|
session_id?: string | undefined;
|
|
841
840
|
auth_connection?: string | undefined;
|
|
842
841
|
auth_strategy?: {
|
|
@@ -845,21 +844,15 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
845
844
|
} | undefined;
|
|
846
845
|
revoked_at?: string | undefined;
|
|
847
846
|
idle_expires_at?: string | undefined;
|
|
847
|
+
organization?: string | undefined;
|
|
848
848
|
last_exchanged_at?: string | undefined;
|
|
849
849
|
}[] | {
|
|
850
|
-
start: number;
|
|
851
|
-
limit: number;
|
|
852
|
-
length: number;
|
|
853
850
|
tokens: {
|
|
854
851
|
user_id: string;
|
|
855
|
-
client_id: string;
|
|
856
|
-
created_at: string;
|
|
857
852
|
id: string;
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}[];
|
|
862
|
-
login_id: string;
|
|
853
|
+
created_at: string;
|
|
854
|
+
client_id: string;
|
|
855
|
+
rotating: boolean;
|
|
863
856
|
device: {
|
|
864
857
|
initial_user_agent: string;
|
|
865
858
|
initial_ip: string;
|
|
@@ -868,9 +861,12 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
868
861
|
last_ip: string;
|
|
869
862
|
last_asn: string;
|
|
870
863
|
};
|
|
871
|
-
|
|
864
|
+
login_id: string;
|
|
865
|
+
resource_servers: {
|
|
866
|
+
audience: string;
|
|
867
|
+
scopes: string;
|
|
868
|
+
}[];
|
|
872
869
|
expires_at?: string | undefined;
|
|
873
|
-
organization?: string | undefined;
|
|
874
870
|
session_id?: string | undefined;
|
|
875
871
|
auth_connection?: string | undefined;
|
|
876
872
|
auth_strategy?: {
|
|
@@ -879,21 +875,20 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
879
875
|
} | undefined;
|
|
880
876
|
revoked_at?: string | undefined;
|
|
881
877
|
idle_expires_at?: string | undefined;
|
|
878
|
+
organization?: string | undefined;
|
|
882
879
|
last_exchanged_at?: string | undefined;
|
|
883
880
|
}[];
|
|
884
|
-
total?: number | undefined;
|
|
885
881
|
next?: string | undefined;
|
|
886
882
|
} | {
|
|
883
|
+
start: number;
|
|
884
|
+
limit: number;
|
|
885
|
+
length: number;
|
|
887
886
|
tokens: {
|
|
888
887
|
user_id: string;
|
|
889
|
-
client_id: string;
|
|
890
|
-
created_at: string;
|
|
891
888
|
id: string;
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}[];
|
|
896
|
-
login_id: string;
|
|
889
|
+
created_at: string;
|
|
890
|
+
client_id: string;
|
|
891
|
+
rotating: boolean;
|
|
897
892
|
device: {
|
|
898
893
|
initial_user_agent: string;
|
|
899
894
|
initial_ip: string;
|
|
@@ -902,9 +897,12 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
902
897
|
last_ip: string;
|
|
903
898
|
last_asn: string;
|
|
904
899
|
};
|
|
905
|
-
|
|
900
|
+
login_id: string;
|
|
901
|
+
resource_servers: {
|
|
902
|
+
audience: string;
|
|
903
|
+
scopes: string;
|
|
904
|
+
}[];
|
|
906
905
|
expires_at?: string | undefined;
|
|
907
|
-
organization?: string | undefined;
|
|
908
906
|
session_id?: string | undefined;
|
|
909
907
|
auth_connection?: string | undefined;
|
|
910
908
|
auth_strategy?: {
|
|
@@ -913,8 +911,10 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
913
911
|
} | undefined;
|
|
914
912
|
revoked_at?: string | undefined;
|
|
915
913
|
idle_expires_at?: string | undefined;
|
|
914
|
+
organization?: string | undefined;
|
|
916
915
|
last_exchanged_at?: string | undefined;
|
|
917
916
|
}[];
|
|
917
|
+
total?: number | undefined;
|
|
918
918
|
next?: string | undefined;
|
|
919
919
|
};
|
|
920
920
|
outputFormat: "json";
|
|
@@ -963,7 +963,7 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
963
963
|
};
|
|
964
964
|
};
|
|
965
965
|
output: {
|
|
966
|
-
type: "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "
|
|
966
|
+
type: "fn" | "i" | "cs" | "fi" | "sv" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "depnote" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
|
|
967
967
|
date: string;
|
|
968
968
|
isMobile: boolean;
|
|
969
969
|
log_id: string;
|
|
@@ -1002,7 +1002,7 @@ export declare const userRoutes: OpenAPIHono<{
|
|
|
1002
1002
|
limit: number;
|
|
1003
1003
|
length: number;
|
|
1004
1004
|
logs: {
|
|
1005
|
-
type: "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "
|
|
1005
|
+
type: "fn" | "i" | "cs" | "fi" | "sv" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "depnote" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "festft" | "fh" | "fimp" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "sestft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum";
|
|
1006
1006
|
date: string;
|
|
1007
1007
|
isMobile: boolean;
|
|
1008
1008
|
log_id: string;
|
|
@@ -72,12 +72,12 @@ 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?: "
|
|
75
|
+
logo_placement?: "widget" | "none" | "chip" | undefined;
|
|
76
76
|
};
|
|
77
77
|
widget: {
|
|
78
78
|
header_text_alignment: "center" | "left" | "right";
|
|
79
79
|
logo_height: number;
|
|
80
|
-
logo_position: "
|
|
80
|
+
logo_position: "center" | "left" | "right" | "none";
|
|
81
81
|
logo_url: string;
|
|
82
82
|
social_buttons_layout: "bottom" | "top";
|
|
83
83
|
};
|
|
@@ -808,12 +808,12 @@ export declare function initJSXRouteWithSession(ctx: Context<{
|
|
|
808
808
|
background_color: string;
|
|
809
809
|
background_image_url: string;
|
|
810
810
|
page_layout: "center" | "left" | "right";
|
|
811
|
-
logo_placement?: "
|
|
811
|
+
logo_placement?: "widget" | "none" | "chip" | undefined;
|
|
812
812
|
};
|
|
813
813
|
widget: {
|
|
814
814
|
header_text_alignment: "center" | "left" | "right";
|
|
815
815
|
logo_height: number;
|
|
816
|
-
logo_position: "
|
|
816
|
+
logo_position: "center" | "left" | "right" | "none";
|
|
817
817
|
logo_url: string;
|
|
818
818
|
social_buttons_layout: "bottom" | "top";
|
|
819
819
|
};
|
|
@@ -10,7 +10,14 @@ export type ErrorPageProps = {
|
|
|
10
10
|
title?: string;
|
|
11
11
|
message: string;
|
|
12
12
|
statusCode: number;
|
|
13
|
-
variant?: "error" | "info";
|
|
13
|
+
variant?: "error" | "info" | "success";
|
|
14
|
+
/** Optional call-to-action rendered as a primary button under the message. */
|
|
15
|
+
action?: {
|
|
16
|
+
label: string;
|
|
17
|
+
href: string;
|
|
18
|
+
};
|
|
19
|
+
/** Overrides the default `lang` attribute ("en"). */
|
|
20
|
+
lang?: string;
|
|
14
21
|
branding?: {
|
|
15
22
|
colors?: {
|
|
16
23
|
primary?: string;
|
|
@@ -37,4 +44,4 @@ export type ErrorPageProps = {
|
|
|
37
44
|
*/
|
|
38
45
|
embed?: boolean;
|
|
39
46
|
};
|
|
40
|
-
export declare function ErrorPage({ title, message, statusCode, variant, branding, theme, darkMode, extraScript, embed, }: ErrorPageProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
47
|
+
export declare function ErrorPage({ title, message, statusCode, variant, action, lang, branding, theme, darkMode, extraScript, embed, }: ErrorPageProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
@@ -27,7 +27,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
|
|
|
27
27
|
output: {
|
|
28
28
|
screen: {
|
|
29
29
|
action: string;
|
|
30
|
-
method: "
|
|
30
|
+
method: "GET" | "POST";
|
|
31
31
|
components: {
|
|
32
32
|
id: string;
|
|
33
33
|
type: string;
|
|
@@ -107,7 +107,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
|
|
|
107
107
|
output: {
|
|
108
108
|
screen: {
|
|
109
109
|
action: string;
|
|
110
|
-
method: "
|
|
110
|
+
method: "GET" | "POST";
|
|
111
111
|
components: {
|
|
112
112
|
id: string;
|
|
113
113
|
type: string;
|
|
@@ -204,7 +204,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
|
|
|
204
204
|
output: {
|
|
205
205
|
screen: {
|
|
206
206
|
action: string;
|
|
207
|
-
method: "
|
|
207
|
+
method: "GET" | "POST";
|
|
208
208
|
components: {
|
|
209
209
|
id: string;
|
|
210
210
|
type: string;
|
|
@@ -319,7 +319,7 @@ export declare const flowApiRoutes: OpenAPIHono<{
|
|
|
319
319
|
output: {
|
|
320
320
|
screen: {
|
|
321
321
|
action: string;
|
|
322
|
-
method: "
|
|
322
|
+
method: "GET" | "POST";
|
|
323
323
|
components: {
|
|
324
324
|
id: string;
|
|
325
325
|
type: string;
|
|
@@ -22,6 +22,13 @@ export declare function escapeCssUrl(url: string): string;
|
|
|
22
22
|
* Sanitize URL for use in href/src attributes
|
|
23
23
|
*/
|
|
24
24
|
export declare function sanitizeUrl(url: string | undefined): string;
|
|
25
|
+
/**
|
|
26
|
+
* Validate a URL for a JSX link `href` and return it unescaped, since JSX
|
|
27
|
+
* escapes attribute values itself (running sanitizeUrl first double-escapes
|
|
28
|
+
* `&` in query strings). Only http(s) and same-origin paths are allowed —
|
|
29
|
+
* no `data:` here, as the result is a clickable link.
|
|
30
|
+
*/
|
|
31
|
+
export declare function safeLinkHref(url: string | undefined): string | undefined;
|
|
25
32
|
/**
|
|
26
33
|
* Sanitize CSS color value
|
|
27
34
|
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email verification screens for logins blocked on an unverified email
|
|
3
|
+
* (client `email_validation: "enforced"`). Which one is shown follows the
|
|
4
|
+
* database connection's `attributes.email.verification_method`:
|
|
5
|
+
*
|
|
6
|
+
* - "code" (default): email-verification-code — enter the emailed code and
|
|
7
|
+
* the same login session continues.
|
|
8
|
+
* - "link": email-verification-link-sent — the emailed link verifies the
|
|
9
|
+
* address and returns the user to the login screen.
|
|
10
|
+
*
|
|
11
|
+
* Corresponds to: /u2/login/email-verification and
|
|
12
|
+
* /u2/login/email-verification-sent
|
|
13
|
+
*/
|
|
14
|
+
import type { ScreenContext, ScreenResult, ScreenDefinition } from "./types";
|
|
15
|
+
import { LoginEmailVerification } from "../../../authentication-flows/email-verification";
|
|
16
|
+
/**
|
|
17
|
+
* The verification options a u2 password login passes to `loginWithPassword`.
|
|
18
|
+
* The link method returns the user to this session's login screen.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getLoginEmailVerification(context: ScreenContext): Promise<LoginEmailVerification>;
|
|
21
|
+
/**
|
|
22
|
+
* The screen to show after a u2 password login threw EMAIL_NOT_VERIFIED. The
|
|
23
|
+
* verification email has already been sent by the password grant.
|
|
24
|
+
*/
|
|
25
|
+
export declare function emailVerificationRequiredScreen(context: ScreenContext, email: string | undefined): Promise<ScreenResult>;
|
|
26
|
+
export declare function emailVerificationCodeScreen(context: ScreenContext): Promise<ScreenResult>;
|
|
27
|
+
export declare function emailVerificationLinkSentScreen(context: ScreenContext): Promise<ScreenResult>;
|
|
28
|
+
export declare const emailVerificationCodeScreenDefinition: ScreenDefinition;
|
|
29
|
+
export declare const emailVerificationLinkSentScreenDefinition: ScreenDefinition;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UiScreen } from "@authhero/adapter-interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Surface a screen handler's `error` as a screen-level message, unless the
|
|
4
|
+
* re-rendered screen already shows an error (on a field or at screen level).
|
|
5
|
+
*
|
|
6
|
+
* Handlers usually attach a localized message to the offending field, so
|
|
7
|
+
* adding `error` on top would show the same problem twice. The fallback only
|
|
8
|
+
* kicks in for handlers that return an error without rendering one, so the
|
|
9
|
+
* user isn't left with an unchanged screen and no explanation.
|
|
10
|
+
*/
|
|
11
|
+
export declare function withHandlerError(screen: UiScreen, error: string): UiScreen;
|
|
@@ -23,8 +23,12 @@ export declare function executePasswordReset(params: {
|
|
|
23
23
|
}): Promise<{
|
|
24
24
|
success: true;
|
|
25
25
|
} | {
|
|
26
|
-
error:
|
|
26
|
+
error: "user_not_found" | "code_expired" | "reset_failed";
|
|
27
27
|
field: "code" | "password";
|
|
28
|
+
} | {
|
|
29
|
+
error: "password_policy";
|
|
30
|
+
field: "password";
|
|
31
|
+
policyError: unknown;
|
|
28
32
|
}>;
|
|
29
33
|
/**
|
|
30
34
|
* Create the reset-password screen
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Corresponds to: /u/signup
|
|
5
5
|
*/
|
|
6
|
+
import type { CustomText } from "@authhero/adapter-interfaces";
|
|
6
7
|
import type { ScreenContext, ScreenResult, ScreenDefinition } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Translate a validatePasswordPolicy failure into a user-facing message.
|
|
10
|
+
* The PasswordPolicyError message itself is English-only.
|
|
11
|
+
*/
|
|
12
|
+
export declare function localizePasswordPolicyError(error: unknown, locale: string, customText?: CustomText): string;
|
|
7
13
|
/**
|
|
8
14
|
* Create the signup screen
|
|
9
15
|
*/
|
|
@@ -165,7 +165,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
165
165
|
$get: {
|
|
166
166
|
input: {
|
|
167
167
|
param: {
|
|
168
|
-
screen: "
|
|
168
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
184
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
200
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
220
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
238
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: {
|
|
@@ -170,7 +170,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
170
170
|
$get: {
|
|
171
171
|
input: {
|
|
172
172
|
param: {
|
|
173
|
-
screen: "
|
|
173
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
189
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
205
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "account" | "consent" | "try-connection-result" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
225
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: "
|
|
243
|
+
screen: "signup" | "login" | "enter-password" | "reset-password" | "impersonate" | "consent" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "login/email-verification" | "login/email-verification-sent" | "reset-password/code" | "reset-password/request" | "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: {
|
|
@@ -140,7 +140,7 @@ export declare const loginSessionMachine: import("xstate").StateMachine<LoginSes
|
|
|
140
140
|
} | {
|
|
141
141
|
type: "setFailureReason";
|
|
142
142
|
params: import("xstate").NonReducibleUnknown;
|
|
143
|
-
}, never, never, "pending" | "failed" | "expired" | "
|
|
143
|
+
}, never, never, "pending" | "failed" | "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, {
|
|
144
144
|
id: "loginSession";
|
|
145
145
|
states: {
|
|
146
146
|
readonly pending: {};
|
|
@@ -204,6 +204,11 @@ export type UserLinkingModeResolver = (params: {
|
|
|
204
204
|
client_id?: string;
|
|
205
205
|
}) => UserLinkingMode | Promise<UserLinkingMode>;
|
|
206
206
|
export type UserLinkingModeOption = UserLinkingMode | UserLinkingModeResolver;
|
|
207
|
+
/**
|
|
208
|
+
* Which action (code hook) console output is persisted to
|
|
209
|
+
* `action_executions.logs`. See `AuthHeroConfig.actionExecutionLogs`.
|
|
210
|
+
*/
|
|
211
|
+
export type ActionExecutionLogCapture = "full" | "errors" | "off";
|
|
207
212
|
/**
|
|
208
213
|
* Resolver for the per-tenant username/password provider value.
|
|
209
214
|
*
|
|
@@ -728,6 +733,26 @@ export interface AuthHeroConfig {
|
|
|
728
733
|
* @default false
|
|
729
734
|
*/
|
|
730
735
|
rejectUnknownHosts?: boolean;
|
|
736
|
+
/**
|
|
737
|
+
* Controls which action (code hook) console output is persisted to
|
|
738
|
+
* `action_executions.logs`. Actions still capture and see their own
|
|
739
|
+
* console output while they run; only what is written to the database
|
|
740
|
+
* changes. The execution record itself (status, results) is always
|
|
741
|
+
* persisted.
|
|
742
|
+
*
|
|
743
|
+
* - `"full"`: persist console output for every action, subject to the
|
|
744
|
+
* 256-character budget per execution.
|
|
745
|
+
* - `"errors"`: persist console output only for actions that failed
|
|
746
|
+
* (errored or denied access). Output from successful actions is dropped.
|
|
747
|
+
* - `"off"`: never persist console output.
|
|
748
|
+
*
|
|
749
|
+
* `credentials-exchange` runs on every token exchange, and console output
|
|
750
|
+
* often contains user PII, so `"errors"` or `"off"` is recommended for
|
|
751
|
+
* high-volume or privacy-sensitive deployments.
|
|
752
|
+
*
|
|
753
|
+
* @default "full"
|
|
754
|
+
*/
|
|
755
|
+
actionExecutionLogs?: ActionExecutionLogCapture;
|
|
731
756
|
/**
|
|
732
757
|
* Relax the management API audience check from a hard 403 to a
|
|
733
758
|
* `console.warn`. Tokens issued for any other audience will still be
|
|
@@ -2,7 +2,7 @@ import type { SigningCertificateAuthority } from "../helpers/signing-certificate
|
|
|
2
2
|
import { CodeExecutor, DataAdapters } from "@authhero/adapter-interfaces";
|
|
3
3
|
import type { SamlSigner } from "@authhero/saml/core";
|
|
4
4
|
import { Hooks } from "./Hooks";
|
|
5
|
-
import { EntityHooksConfig, McpConfig, OutboxConfig, SigningKeyModeOption, TenantOperationExecutorBinding, UserLinkingModeOption, UsernamePasswordProviderResolver, WebhookInvoker } from "./AuthHeroConfig";
|
|
5
|
+
import { ActionExecutionLogCapture, EntityHooksConfig, McpConfig, OutboxConfig, SigningKeyModeOption, TenantOperationExecutorBinding, UserLinkingModeOption, UsernamePasswordProviderResolver, WebhookInvoker } from "./AuthHeroConfig";
|
|
6
6
|
import { StrategyHandler } from "../strategies";
|
|
7
7
|
export type Bindings = {
|
|
8
8
|
ENVIRONMENT: string;
|
|
@@ -11,6 +11,12 @@ export type Bindings = {
|
|
|
11
11
|
UNIVERSAL_LOGIN_URL?: string;
|
|
12
12
|
OAUTH_API_URL?: string;
|
|
13
13
|
ENCRYPTION_KEY?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Read `ctx.var.data` instead. Holds the raw adapter passed in
|
|
16
|
+
* at startup until a route group composes its per-request stack, after
|
|
17
|
+
* which it is a compatibility alias for the same object as `ctx.var.data`.
|
|
18
|
+
* The alias will be removed in the next major release (#140).
|
|
19
|
+
*/
|
|
14
20
|
data: DataAdapters;
|
|
15
21
|
hooks?: Hooks;
|
|
16
22
|
/**
|
|
@@ -45,6 +51,7 @@ export type Bindings = {
|
|
|
45
51
|
signingKeyMode?: SigningKeyModeOption;
|
|
46
52
|
signingCertificateAuthority?: SigningCertificateAuthority;
|
|
47
53
|
rejectUnknownHosts?: boolean;
|
|
54
|
+
actionExecutionLogs?: ActionExecutionLogCapture;
|
|
48
55
|
mcp?: McpConfig;
|
|
49
56
|
/**
|
|
50
57
|
* Allow outbound fetches (jwks_uri, request_uri) to localhost / private IP
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import { LoginSession } from "@authhero/adapter-interfaces";
|
|
1
|
+
import { DataAdapters, LoginSession } from "@authhero/adapter-interfaces";
|
|
2
2
|
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
6
|
export type Variables = {
|
|
7
|
+
/**
|
|
8
|
+
* The adapter stack for this request. Read this, not `ctx.env.data`.
|
|
9
|
+
*
|
|
10
|
+
* Route groups compose a per-request stack (`composeAuthData({ ctx, ... })`)
|
|
11
|
+
* that holds request-scoped state: the dedup map, the client-bundle promise
|
|
12
|
+
* and hooks bound to this `ctx`. It lives here rather than on `env` because
|
|
13
|
+
* Cloudflare Workers hand every request in an isolate the same `env`
|
|
14
|
+
* object, so a stack stored there leaks between concurrent requests (#140).
|
|
15
|
+
*
|
|
16
|
+
* Typed as required because `applyConfigMiddleware`, the first middleware
|
|
17
|
+
* of every route group, always sets it (to the startup adapter until a
|
|
18
|
+
* route group composes its own stack). Optional would force a guard on
|
|
19
|
+
* every read for a case that cannot happen behind that middleware; code
|
|
20
|
+
* mounted without it has to set the variable itself. Set it through
|
|
21
|
+
* `setRequestData` so the deprecated `ctx.env.data` alias stays in sync.
|
|
22
|
+
*/
|
|
23
|
+
data: DataAdapters;
|
|
7
24
|
tenant_id: string;
|
|
8
25
|
ip: string;
|
|
9
26
|
client_id?: string;
|