authhero 9.44.2 → 9.44.4
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 +128 -128
- package/dist/authhero.d.ts +464 -464
- package/dist/authhero.mjs +13324 -13310
- package/dist/{mfa-CX1JyNyV.mjs → mfa-D56D6aKD.mjs} +108 -108
- package/dist/{mfa-B0J_xOxl.js → mfa-Es8y5_jQ.js} +2 -2
- package/dist/{mfa-attempts-BNf9KSrR.mjs → mfa-attempts-4i0wth1x.mjs} +2311 -2245
- package/dist/{mfa-attempts-suDM5Cv-.js → mfa-attempts-DxkUcou5.js} +4 -4
- package/dist/{passkey-enrollment-D180Gog3.js → passkey-enrollment-BTMWec3j.js} +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/hooks/post-user-login.d.ts +51 -16
- package/dist/types/hooks/pre-defined/ensure-username.d.ts +3 -0
- package/dist/types/index.d.ts +464 -464
- package/dist/types/routes/auth-api/index.d.ts +26 -26
- package/dist/types/routes/auth-api/passwordless.d.ts +6 -6
- package/dist/types/routes/management-api/connections.d.ts +1 -1
- package/dist/types/routes/management-api/index.d.ts +433 -433
- package/dist/types/routes/management-api/users.d.ts +6 -6
- package/dist/types/routes/universal-login/flow-api.d.ts +8 -8
- package/dist/types/routes/universal-login/identifier.d.ts +2 -2
- package/dist/types/routes/universal-login/index.d.ts +2 -2
- 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 +5 -5
|
@@ -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 {};
|
|
@@ -34,6 +34,9 @@ export declare function slugify(input: string): string | undefined;
|
|
|
34
34
|
* 2. name
|
|
35
35
|
* 3. Local part of email (before @)
|
|
36
36
|
* 4. phone_number
|
|
37
|
+
* 5. Local part of email plus the email domain without its top-level domain
|
|
38
|
+
* (`info@example-shop.com` → `info-example-shop`). Last, because it is only
|
|
39
|
+
* needed when shared mailbox names such as `info` or `kontakt` are taken.
|
|
37
40
|
*
|
|
38
41
|
* Each value is slugified. Duplicates are removed while preserving order.
|
|
39
42
|
*/
|