authhero 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authhero.cjs +54 -52
- package/dist/authhero.d.ts +66 -33
- package/dist/authhero.mjs +16259 -13531
- package/dist/stats.html +1 -1
- package/package.json +5 -4
package/dist/authhero.d.ts
CHANGED
|
@@ -32323,6 +32323,27 @@ export interface ListParams {
|
|
|
32323
32323
|
from?: string;
|
|
32324
32324
|
take?: number;
|
|
32325
32325
|
}
|
|
32326
|
+
export declare enum LoginSessionState {
|
|
32327
|
+
/** Initial state - awaiting user authentication */
|
|
32328
|
+
PENDING = "pending",
|
|
32329
|
+
/** User credentials validated, but may need additional steps */
|
|
32330
|
+
AUTHENTICATED = "authenticated",
|
|
32331
|
+
/** Waiting for email verification */
|
|
32332
|
+
AWAITING_EMAIL_VERIFICATION = "awaiting_email_verification",
|
|
32333
|
+
/** Waiting for hook/flow completion (form, page redirect) */
|
|
32334
|
+
AWAITING_HOOK = "awaiting_hook",
|
|
32335
|
+
/** Waiting for user to complete action on continuation page (change-email, account, etc.) */
|
|
32336
|
+
AWAITING_CONTINUATION = "awaiting_continuation",
|
|
32337
|
+
/** Tokens issued successfully */
|
|
32338
|
+
COMPLETED = "completed",
|
|
32339
|
+
/** Authentication failed (wrong password, blocked, etc.) */
|
|
32340
|
+
FAILED = "failed",
|
|
32341
|
+
/** Session timed out */
|
|
32342
|
+
EXPIRED = "expired"
|
|
32343
|
+
}
|
|
32344
|
+
export declare const loginSessionStateSchema: z.ZodNativeEnum<typeof LoginSessionState>;
|
|
32345
|
+
/** Continuation scope - which pages/actions are allowed during continuation */
|
|
32346
|
+
export type ContinuationScope = "change-email" | "account" | "custom";
|
|
32326
32347
|
export declare const loginSessionInsertSchema: z.ZodObject<{
|
|
32327
32348
|
csrf_token: z.ZodString;
|
|
32328
32349
|
auth0Client: z.ZodOptional<z.ZodString>;
|
|
@@ -32384,8 +32405,12 @@ export declare const loginSessionInsertSchema: z.ZodObject<{
|
|
|
32384
32405
|
useragent: z.ZodOptional<z.ZodString>;
|
|
32385
32406
|
session_id: z.ZodOptional<z.ZodString>;
|
|
32386
32407
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
32387
|
-
|
|
32408
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof LoginSessionState>>>;
|
|
32409
|
+
state_data: z.ZodOptional<z.ZodString>;
|
|
32410
|
+
failure_reason: z.ZodOptional<z.ZodString>;
|
|
32411
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
32388
32412
|
}, "strip", z.ZodTypeAny, {
|
|
32413
|
+
state: LoginSessionState;
|
|
32389
32414
|
expires_at: string;
|
|
32390
32415
|
csrf_token: string;
|
|
32391
32416
|
authParams: {
|
|
@@ -32406,13 +32431,15 @@ export declare const loginSessionInsertSchema: z.ZodObject<{
|
|
|
32406
32431
|
ui_locales?: string | undefined;
|
|
32407
32432
|
vendor_id?: string | undefined;
|
|
32408
32433
|
};
|
|
32409
|
-
|
|
32434
|
+
user_id?: string | undefined;
|
|
32410
32435
|
auth0Client?: string | undefined;
|
|
32411
32436
|
deleted_at?: string | undefined;
|
|
32412
32437
|
ip?: string | undefined;
|
|
32413
32438
|
useragent?: string | undefined;
|
|
32414
32439
|
session_id?: string | undefined;
|
|
32415
32440
|
authorization_url?: string | undefined;
|
|
32441
|
+
state_data?: string | undefined;
|
|
32442
|
+
failure_reason?: string | undefined;
|
|
32416
32443
|
}, {
|
|
32417
32444
|
expires_at: string;
|
|
32418
32445
|
csrf_token: string;
|
|
@@ -32434,13 +32461,16 @@ export declare const loginSessionInsertSchema: z.ZodObject<{
|
|
|
32434
32461
|
ui_locales?: string | undefined;
|
|
32435
32462
|
vendor_id?: string | undefined;
|
|
32436
32463
|
};
|
|
32464
|
+
user_id?: string | undefined;
|
|
32465
|
+
state?: LoginSessionState | undefined;
|
|
32437
32466
|
auth0Client?: string | undefined;
|
|
32438
32467
|
deleted_at?: string | undefined;
|
|
32439
32468
|
ip?: string | undefined;
|
|
32440
32469
|
useragent?: string | undefined;
|
|
32441
32470
|
session_id?: string | undefined;
|
|
32442
32471
|
authorization_url?: string | undefined;
|
|
32443
|
-
|
|
32472
|
+
state_data?: string | undefined;
|
|
32473
|
+
failure_reason?: string | undefined;
|
|
32444
32474
|
}>;
|
|
32445
32475
|
export type LoginSessionInsert = z.input<typeof loginSessionInsertSchema>;
|
|
32446
32476
|
export declare const loginSessionSchema: z.ZodObject<{
|
|
@@ -32507,11 +32537,15 @@ export declare const loginSessionSchema: z.ZodObject<{
|
|
|
32507
32537
|
useragent: z.ZodOptional<z.ZodString>;
|
|
32508
32538
|
session_id: z.ZodOptional<z.ZodString>;
|
|
32509
32539
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
32510
|
-
|
|
32540
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof LoginSessionState>>>;
|
|
32541
|
+
state_data: z.ZodOptional<z.ZodString>;
|
|
32542
|
+
failure_reason: z.ZodOptional<z.ZodString>;
|
|
32543
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
32511
32544
|
}, "strip", z.ZodTypeAny, {
|
|
32512
32545
|
created_at: string;
|
|
32513
32546
|
updated_at: string;
|
|
32514
32547
|
id: string;
|
|
32548
|
+
state: LoginSessionState;
|
|
32515
32549
|
expires_at: string;
|
|
32516
32550
|
csrf_token: string;
|
|
32517
32551
|
authParams: {
|
|
@@ -32532,13 +32566,15 @@ export declare const loginSessionSchema: z.ZodObject<{
|
|
|
32532
32566
|
ui_locales?: string | undefined;
|
|
32533
32567
|
vendor_id?: string | undefined;
|
|
32534
32568
|
};
|
|
32535
|
-
|
|
32569
|
+
user_id?: string | undefined;
|
|
32536
32570
|
auth0Client?: string | undefined;
|
|
32537
32571
|
deleted_at?: string | undefined;
|
|
32538
32572
|
ip?: string | undefined;
|
|
32539
32573
|
useragent?: string | undefined;
|
|
32540
32574
|
session_id?: string | undefined;
|
|
32541
32575
|
authorization_url?: string | undefined;
|
|
32576
|
+
state_data?: string | undefined;
|
|
32577
|
+
failure_reason?: string | undefined;
|
|
32542
32578
|
}, {
|
|
32543
32579
|
created_at: string;
|
|
32544
32580
|
updated_at: string;
|
|
@@ -32563,13 +32599,16 @@ export declare const loginSessionSchema: z.ZodObject<{
|
|
|
32563
32599
|
ui_locales?: string | undefined;
|
|
32564
32600
|
vendor_id?: string | undefined;
|
|
32565
32601
|
};
|
|
32602
|
+
user_id?: string | undefined;
|
|
32603
|
+
state?: LoginSessionState | undefined;
|
|
32566
32604
|
auth0Client?: string | undefined;
|
|
32567
32605
|
deleted_at?: string | undefined;
|
|
32568
32606
|
ip?: string | undefined;
|
|
32569
32607
|
useragent?: string | undefined;
|
|
32570
32608
|
session_id?: string | undefined;
|
|
32571
32609
|
authorization_url?: string | undefined;
|
|
32572
|
-
|
|
32610
|
+
state_data?: string | undefined;
|
|
32611
|
+
failure_reason?: string | undefined;
|
|
32573
32612
|
}>;
|
|
32574
32613
|
export type LoginSession = z.infer<typeof loginSessionSchema>;
|
|
32575
32614
|
export declare const LogTypes: {
|
|
@@ -37798,6 +37837,22 @@ export type OnFetchUserInfoAPI = {
|
|
|
37798
37837
|
};
|
|
37799
37838
|
/** Called when /userinfo endpoint is accessed */
|
|
37800
37839
|
export type OnFetchUserInfo = (event: UserInfoEvent, api: OnFetchUserInfoAPI) => Promise<void>;
|
|
37840
|
+
/**
|
|
37841
|
+
* All available auth flow hooks.
|
|
37842
|
+
* This type is shared between AuthHeroConfig and Bindings to ensure consistency.
|
|
37843
|
+
*/
|
|
37844
|
+
export type Hooks = {
|
|
37845
|
+
onExecuteCredentialsExchange?: OnExecuteCredentialsExchange;
|
|
37846
|
+
onExecutePreUserRegistration?: OnExecutePreUserRegistration;
|
|
37847
|
+
onExecutePostUserRegistration?: OnExecutePostUserRegistration;
|
|
37848
|
+
onExecutePreUserUpdate?: OnExecutePreUserUpdate;
|
|
37849
|
+
onExecutePostLogin?: OnExecutePostLogin;
|
|
37850
|
+
onExecutePreUserDeletion?: OnExecutePreUserDeletion;
|
|
37851
|
+
onExecutePostUserDeletion?: OnExecutePostUserDeletion;
|
|
37852
|
+
onExecuteValidateRegistrationUsername?: OnExecuteValidateRegistrationUsername;
|
|
37853
|
+
/** Called when /userinfo endpoint is accessed to add custom claims */
|
|
37854
|
+
onFetchUserInfo?: OnFetchUserInfo;
|
|
37855
|
+
};
|
|
37801
37856
|
/**
|
|
37802
37857
|
* Entity hooks configuration for CRUD operations.
|
|
37803
37858
|
*
|
|
@@ -37838,18 +37893,7 @@ export interface AuthHeroConfig {
|
|
|
37838
37893
|
/**
|
|
37839
37894
|
* Auth0-style action hooks for auth flow events.
|
|
37840
37895
|
*/
|
|
37841
|
-
hooks?:
|
|
37842
|
-
onExecuteCredentialsExchange?: OnExecuteCredentialsExchange;
|
|
37843
|
-
onExecutePreUserRegistration?: OnExecutePreUserRegistration;
|
|
37844
|
-
onExecutePostUserRegistration?: OnExecutePostUserRegistration;
|
|
37845
|
-
onExecutePreUserUpdate?: OnExecutePreUserUpdate;
|
|
37846
|
-
onExecutePostLogin?: OnExecutePostLogin;
|
|
37847
|
-
/**
|
|
37848
|
-
* Called when the /userinfo endpoint is accessed.
|
|
37849
|
-
* Use this to add custom claims to the userinfo response.
|
|
37850
|
-
*/
|
|
37851
|
-
onFetchUserInfo?: OnFetchUserInfo;
|
|
37852
|
-
};
|
|
37896
|
+
hooks?: Hooks;
|
|
37853
37897
|
/**
|
|
37854
37898
|
* Entity CRUD hooks for when resources are created/updated/deleted.
|
|
37855
37899
|
* Use these to implement cross-tenant sync, audit logging, webhooks, etc.
|
|
@@ -37980,18 +38024,7 @@ export type Bindings = {
|
|
|
37980
38024
|
UNIVERSAL_LOGIN_URL?: string;
|
|
37981
38025
|
OAUTH_API_URL?: string;
|
|
37982
38026
|
data: DataAdapters;
|
|
37983
|
-
hooks?:
|
|
37984
|
-
onExecuteCredentialsExchange?: OnExecuteCredentialsExchange;
|
|
37985
|
-
onExecutePreUserRegistration?: OnExecutePreUserRegistration;
|
|
37986
|
-
onExecutePostUserRegistration?: OnExecutePostUserRegistration;
|
|
37987
|
-
onExecutePreUserUpdate?: OnExecutePreUserUpdate;
|
|
37988
|
-
onExecutePostLogin?: OnExecutePostLogin;
|
|
37989
|
-
onExecutePreUserDeletion?: OnExecutePreUserDeletion;
|
|
37990
|
-
onExecutePostUserDeletion?: OnExecutePostUserDeletion;
|
|
37991
|
-
onExecuteValidateRegistrationUsername?: OnExecuteValidateRegistrationUsername;
|
|
37992
|
-
/** Called when /userinfo endpoint is accessed to add custom claims */
|
|
37993
|
-
onFetchUserInfo?: OnFetchUserInfo;
|
|
37994
|
-
};
|
|
38027
|
+
hooks?: Hooks;
|
|
37995
38028
|
/**
|
|
37996
38029
|
* Entity CRUD hooks for when resources are created/updated/deleted.
|
|
37997
38030
|
* Use these to implement cross-tenant sync, audit logging, webhooks, etc.
|
|
@@ -46727,7 +46760,7 @@ export declare function init(config: AuthHeroConfig): {
|
|
|
46727
46760
|
} & {
|
|
46728
46761
|
json: {
|
|
46729
46762
|
type?: "auth0_managed_certs" | "self_managed_certs" | undefined;
|
|
46730
|
-
status?: "
|
|
46763
|
+
status?: "pending" | "disabled" | "pending_verification" | "ready" | undefined;
|
|
46731
46764
|
primary?: boolean | undefined;
|
|
46732
46765
|
domain?: string | undefined;
|
|
46733
46766
|
custom_domain_id?: string | undefined;
|
|
@@ -48940,6 +48973,7 @@ export declare function init(config: AuthHeroConfig): {
|
|
|
48940
48973
|
type: string;
|
|
48941
48974
|
id: string;
|
|
48942
48975
|
required?: boolean | undefined;
|
|
48976
|
+
order?: number | undefined;
|
|
48943
48977
|
category?: string | undefined;
|
|
48944
48978
|
config?: {
|
|
48945
48979
|
[x: string]: any;
|
|
@@ -48950,7 +48984,6 @@ export declare function init(config: AuthHeroConfig): {
|
|
|
48950
48984
|
id?: number | undefined;
|
|
48951
48985
|
}[] | undefined;
|
|
48952
48986
|
visible?: boolean | undefined;
|
|
48953
|
-
order?: number | undefined;
|
|
48954
48987
|
sensitive?: boolean | undefined;
|
|
48955
48988
|
label?: string | undefined;
|
|
48956
48989
|
hint?: string | undefined;
|
|
@@ -49052,6 +49085,7 @@ export declare function init(config: AuthHeroConfig): {
|
|
|
49052
49085
|
type: string;
|
|
49053
49086
|
id: string;
|
|
49054
49087
|
required?: boolean | undefined;
|
|
49088
|
+
order?: number | undefined;
|
|
49055
49089
|
category?: string | undefined;
|
|
49056
49090
|
config?: {
|
|
49057
49091
|
[x: string]: any;
|
|
@@ -49062,7 +49096,6 @@ export declare function init(config: AuthHeroConfig): {
|
|
|
49062
49096
|
id?: number | undefined;
|
|
49063
49097
|
}[] | undefined;
|
|
49064
49098
|
visible?: boolean | undefined;
|
|
49065
|
-
order?: number | undefined;
|
|
49066
49099
|
sensitive?: boolean | undefined;
|
|
49067
49100
|
label?: string | undefined;
|
|
49068
49101
|
hint?: string | undefined;
|