authhero 9.44.1 → 9.44.3
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 +137 -137
- package/dist/authhero.d.ts +396 -394
- package/dist/authhero.mjs +13601 -13497
- package/dist/{mfa-B0J_xOxl.js → mfa-Bo75sbdf.js} +2 -2
- package/dist/{mfa-CX1JyNyV.mjs → mfa-CzRZIlzU.mjs} +108 -108
- package/dist/{mfa-attempts-BNf9KSrR.mjs → mfa-attempts-CkOmlAmq.mjs} +2123 -2077
- package/dist/{mfa-attempts-suDM5Cv-.js → mfa-attempts-SqFc5Xcs.js} +14 -14
- package/dist/{passkey-enrollment-D180Gog3.js → passkey-enrollment-B0D65nrS.js} +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/helpers/tenant-export-import/redact.d.ts +3 -0
- package/dist/types/helpers/tenant-export-import/types.d.ts +5 -0
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/hooks/post-user-login.d.ts +51 -16
- package/dist/types/index.d.ts +396 -394
- package/dist/types/routes/auth-api/index.d.ts +28 -28
- package/dist/types/routes/auth-api/passwordless.d.ts +6 -6
- package/dist/types/routes/management-api/connections.d.ts +9 -9
- package/dist/types/routes/management-api/index.d.ts +363 -361
- package/dist/types/routes/management-api/tenant-export-import.d.ts +2 -0
- package/dist/types/routes/management-api/users.d.ts +27 -27
- package/dist/types/routes/universal-login/common.d.ts +4 -4
- package/dist/types/routes/universal-login/flow-api.d.ts +8 -8
- 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/package.json +3 -3
|
@@ -12,6 +12,11 @@ export interface ExportLine {
|
|
|
12
12
|
data: unknown;
|
|
13
13
|
}
|
|
14
14
|
export interface ExportOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Preserve stored credentials other than password hashes. Defaults to true
|
|
17
|
+
* for internal backups. HTTP callers must explicitly opt in and be authorized.
|
|
18
|
+
*/
|
|
19
|
+
includeCredentials?: boolean;
|
|
15
20
|
/**
|
|
16
21
|
* When false, the `passwords` entity is skipped entirely on export so the
|
|
17
22
|
* stream never carries password hashes. Defaults to false at the call sites
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export { addDataHooks } from "./addDataHooks";
|
|
17
17
|
export { validateSignupEmail, preUserSignupHook } from "./validate-signup";
|
|
18
|
-
export { postUserLoginHook } from "./post-user-login";
|
|
18
|
+
export { postUserLoginHook, postLoginActionsForSilentAuth, } from "./post-user-login";
|
|
19
19
|
export { validateSignupEmail as validateRegistrationUsername } from "./validate-signup";
|
|
20
20
|
export { preUserSignupHook as preUserRegistrationHook } from "./validate-signup";
|
|
@@ -15,6 +15,22 @@ import { MfaRequiredByAction } from "../state-machines/login-session";
|
|
|
15
15
|
* only be remembered when every enabling call allowed it.
|
|
16
16
|
*/
|
|
17
17
|
export declare function mergeMfaRequest(current: MfaRequiredByAction | undefined, provider: unknown, options: unknown): MfaRequiredByAction | undefined;
|
|
18
|
+
interface PostUserLoginParams {
|
|
19
|
+
client?: EnrichedClient;
|
|
20
|
+
authParams?: any;
|
|
21
|
+
authStrategy?: {
|
|
22
|
+
strategy: string;
|
|
23
|
+
strategy_type: string;
|
|
24
|
+
};
|
|
25
|
+
/** The connection name actually used to authenticate. */
|
|
26
|
+
authConnection?: string;
|
|
27
|
+
/**
|
|
28
|
+
* True when the login completed by reusing an existing SSO session
|
|
29
|
+
* rather than fresh credentials. Page hooks (e.g. impersonate) only
|
|
30
|
+
* interrupt fresh logins.
|
|
31
|
+
*/
|
|
32
|
+
sessionReused?: boolean;
|
|
33
|
+
}
|
|
18
34
|
/**
|
|
19
35
|
* Checks for post-user-login hooks (form, page, template, code, or webhook)
|
|
20
36
|
* and handles them in that order. Also:
|
|
@@ -32,19 +48,38 @@ export declare function mergeMfaRequest(current: MfaRequiredByAction | undefined
|
|
|
32
48
|
export declare function postUserLoginHook(ctx: Context<{
|
|
33
49
|
Bindings: Bindings;
|
|
34
50
|
Variables: Variables;
|
|
35
|
-
}>, data: DataAdapters, tenant_id: string, user: User, loginSession?: LoginSession, params?:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
}>, data: DataAdapters, tenant_id: string, user: User, loginSession?: LoginSession, params?: PostUserLoginParams): Promise<User | Response>;
|
|
52
|
+
export type SilentPostLoginResult = {
|
|
53
|
+
status: "ok";
|
|
54
|
+
user: User;
|
|
55
|
+
} | {
|
|
56
|
+
status: "interaction_required" | "access_denied";
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Runs the post-login actions for silent authentication (`prompt=none`): the
|
|
61
|
+
* `ctx.env.hooks.onExecutePostLogin` hook and the tenant's code hooks, with
|
|
62
|
+
* the same event and API an interactive login gives them
|
|
63
|
+
* (`event.transaction.prompt` is `"none"`).
|
|
64
|
+
*
|
|
65
|
+
* Nothing can be shown to the user here, so what an action asks for is
|
|
66
|
+
* reported back instead of acted on:
|
|
67
|
+
* - `api.access.deny(...)`, a failing `fail_closed` action, or a client
|
|
68
|
+
* error (4xx `HTTPException`) thrown by `onExecutePostLogin` is
|
|
69
|
+
* `access_denied`;
|
|
70
|
+
* - `api.multifactor.enable(...)` is `interaction_required` unless the browser
|
|
71
|
+
* session already completed MFA for this user, or the browser is remembered
|
|
72
|
+
* and the action allows that;
|
|
73
|
+
* - a redirect requested by `onExecutePostLogin` is `interaction_required`.
|
|
74
|
+
*
|
|
75
|
+
* A silent authentication is not a new login: `login_count` and `last_login`
|
|
76
|
+
* stay as they are, no login is logged, and the template, form, page and
|
|
77
|
+
* webhook hooks of the trigger do not run.
|
|
78
|
+
*/
|
|
79
|
+
export declare function postLoginActionsForSilentAuth(ctx: Context<{
|
|
80
|
+
Bindings: Bindings;
|
|
81
|
+
Variables: Variables;
|
|
82
|
+
}>, data: DataAdapters, tenant_id: string, user: User, loginSession: LoginSession, params: PostUserLoginParams & {
|
|
83
|
+
client: EnrichedClient;
|
|
84
|
+
}): Promise<SilentPostLoginResult>;
|
|
85
|
+
export {};
|