authhero 9.28.3 → 9.30.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 +166 -405
- package/dist/authhero.d.ts +351 -296
- package/dist/authhero.mjs +28767 -55112
- package/dist/mfa-attempts-CQiD6hxP.mjs +26774 -0
- package/dist/mfa-attempts-DwATCXqC.js +254 -0
- package/dist/passkey-enrollment-D_WVyvv2.js +1 -0
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/common.d.ts +4 -0
- package/dist/types/authentication-flows/mfa-attempts.d.ts +45 -0
- package/dist/types/authentication-flows/mfa.d.ts +20 -5
- package/dist/types/authentication-flows/passwordless.d.ts +4 -4
- package/dist/types/generated/locale-types.d.ts +6 -0
- package/dist/types/helpers/client.d.ts +2 -0
- package/dist/types/helpers/reserved-claims.d.ts +2 -2
- package/dist/types/helpers/session-mfa.d.ts +29 -0
- package/dist/types/hooks/post-user-login.d.ts +13 -0
- package/dist/types/index.d.ts +324 -296
- package/dist/types/routes/auth-api/index.d.ts +32 -32
- package/dist/types/routes/auth-api/passwordless.d.ts +16 -16
- package/dist/types/routes/auth-api/revoke.d.ts +6 -6
- package/dist/types/routes/auth-api/token.d.ts +10 -10
- package/dist/types/routes/management-api/action-executions.d.ts +1 -1
- package/dist/types/routes/management-api/actions.d.ts +1 -1
- package/dist/types/routes/management-api/branding.d.ts +1 -1
- package/dist/types/routes/management-api/clients.d.ts +2 -2
- 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 +2 -2
- 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/index.d.ts +108 -80
- package/dist/types/routes/management-api/keys.d.ts +4 -4
- 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 +1 -1
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/roles.d.ts +1 -1
- package/dist/types/routes/management-api/sessions.d.ts +7 -0
- package/dist/types/routes/management-api/tenants.d.ts +6 -6
- package/dist/types/routes/management-api/users.d.ts +45 -24
- package/dist/types/routes/universal-login/common.d.ts +13 -6
- package/dist/types/seed.d.ts +6 -0
- package/dist/types/state-machines/login-session.d.ts +18 -0
- package/dist/types/types/AuthHeroConfig.d.ts +9 -0
- package/dist/types/types/Hooks.d.ts +10 -0
- package/dist/types/utils/totp.d.ts +6 -1
- package/package.json +6 -6
- package/dist/passkey-enrollment-CB7HjMH_.js +0 -1
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import { type PasswordResetFlow } from "./password-reset";
|
|
2
2
|
import { LoginSession, LoginSessionState } from "@authhero/adapter-interfaces";
|
|
3
3
|
import type { SessionCookieDiagnostics } from "../utils/cookies";
|
|
4
|
+
export interface MfaRequiredByAction {
|
|
5
|
+
/** The provider the (last enabling) action passed, e.g. "any". */
|
|
6
|
+
provider: string;
|
|
7
|
+
/** Recorded for remember-browser support; not acted on yet. */
|
|
8
|
+
allow_remember_browser: boolean;
|
|
9
|
+
}
|
|
4
10
|
/** Persisted context, grouped by responsibility in types, flat on disk. */
|
|
5
11
|
export interface LoginSessionData {
|
|
6
12
|
passwordReset?: PasswordResetFlow;
|
|
7
13
|
mfa_verified?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Set when a post-login action called `api.multifactor.enable(...)`. Forces
|
|
16
|
+
* MFA regardless of the tenant policy, and marks that post-login hooks have
|
|
17
|
+
* already run for this login so the resume after MFA does not run them again.
|
|
18
|
+
*/
|
|
19
|
+
mfa_required_by_action?: MfaRequiredByAction;
|
|
20
|
+
/** Authentication method type that satisfied MFA (e.g. "totp", "phone") */
|
|
21
|
+
mfa_method?: string;
|
|
22
|
+
/** When MFA was verified (ISO 8601); copied onto the browser session */
|
|
23
|
+
mfa_verified_at?: string;
|
|
8
24
|
authenticationMethodId?: string;
|
|
9
25
|
phoneNumber?: string;
|
|
10
26
|
totpSecret?: string;
|
|
11
27
|
guardian_enrollment?: boolean;
|
|
28
|
+
mfa_failed_attempts?: number;
|
|
29
|
+
mfa_sms_sent?: number;
|
|
12
30
|
pending_email_verification?: unknown;
|
|
13
31
|
hookId?: string;
|
|
14
32
|
form_values?: Record<string, unknown>;
|
|
@@ -121,6 +121,15 @@ export interface ManagementApiExtension {
|
|
|
121
121
|
* (e.g., from multi-tenancy package).
|
|
122
122
|
*/
|
|
123
123
|
router: OpenAPIHono<any, any, any>;
|
|
124
|
+
/**
|
|
125
|
+
* Set when the routes act on the control plane's own records (for example
|
|
126
|
+
* the tenant records `@authhero/multi-tenancy` mounts at `/tenants`). With
|
|
127
|
+
* `tenantDispatch`, a request for a tenant that runs in its own worker would
|
|
128
|
+
* otherwise be forwarded there, where those records do not exist. Requests
|
|
129
|
+
* to these routes are served here instead. `/tenants/settings` is the one
|
|
130
|
+
* exception: it is the tenant's own and still goes to its worker.
|
|
131
|
+
*/
|
|
132
|
+
controlPlane?: boolean;
|
|
124
133
|
}
|
|
125
134
|
/**
|
|
126
135
|
* Enqueues a durable tenant lifecycle operation (issue #1026): creates
|
|
@@ -186,6 +186,16 @@ export type OnExecutePostLoginAPI = {
|
|
|
186
186
|
prompt: {
|
|
187
187
|
render: (formId: string) => void;
|
|
188
188
|
};
|
|
189
|
+
/**
|
|
190
|
+
* Require MFA for this login (Auth0's `api.multifactor`). Any provider other
|
|
191
|
+
* than `"none"` requires MFA with any factor the tenant has enabled;
|
|
192
|
+
* `"none"` never removes MFA required by the tenant policy or another action.
|
|
193
|
+
*/
|
|
194
|
+
multifactor: {
|
|
195
|
+
enable: (provider: string, options?: {
|
|
196
|
+
allowRememberBrowser?: boolean;
|
|
197
|
+
}) => void;
|
|
198
|
+
};
|
|
189
199
|
redirect: {
|
|
190
200
|
sendUserTo: (url: string, options?: {
|
|
191
201
|
query?: Record<string, string>;
|
|
@@ -4,7 +4,12 @@ export declare function generateTOTP(secret: Uint8Array): Promise<string>;
|
|
|
4
4
|
* Verify a code against the current period ±1 (RFC 6238 §6 recommends
|
|
5
5
|
* tolerating one step of transmission delay / clock drift, and oslo's
|
|
6
6
|
* current-slice-only check made codes fail at period boundaries).
|
|
7
|
+
*
|
|
8
|
+
* Returns the matched time step (counter), or null if the code does not
|
|
9
|
+
* match. Callers must record the step with
|
|
10
|
+
* `authenticationMethods.consumeTotpStep` and reject the code if that fails,
|
|
11
|
+
* so an accepted code cannot be replayed within its window (RFC 6238 §5.2).
|
|
7
12
|
*/
|
|
8
|
-
export declare function verifyTOTP(code: string, secret: Uint8Array): Promise<
|
|
13
|
+
export declare function verifyTOTP(code: string, secret: Uint8Array): Promise<number | null>;
|
|
9
14
|
/** otpauth:// URI for enrolling the secret in an authenticator app. */
|
|
10
15
|
export declare function createTOTPKeyURI(issuer: string, accountName: string, secret: Uint8Array): string;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/sesamyab/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "9.
|
|
14
|
+
"version": "9.30.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"vite": "^8.0.14",
|
|
64
64
|
"vite-plugin-dts": "^4.5.4",
|
|
65
65
|
"vitest": "^4.1.7",
|
|
66
|
-
"@authhero/kysely-adapter": "12.
|
|
67
|
-
"@authhero/widget": "0.41.
|
|
66
|
+
"@authhero/kysely-adapter": "12.19.0",
|
|
67
|
+
"@authhero/widget": "0.41.10"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@peculiar/x509": "^1.14.3",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"qrcode": "^1.5.4",
|
|
82
82
|
"sanitize-html": "^2.17.4",
|
|
83
83
|
"xstate": "^5.31.1",
|
|
84
|
-
"@authhero/adapter-interfaces": "4.
|
|
85
|
-
"@authhero/proxy": "0.11.
|
|
86
|
-
"@authhero/saml": "0.6.
|
|
84
|
+
"@authhero/adapter-interfaces": "4.26.0",
|
|
85
|
+
"@authhero/proxy": "0.11.13",
|
|
86
|
+
"@authhero/saml": "0.6.6"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@authhero/widget": ">=0.38.9",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require("./authhero.cjs");var e=[`passkey`,`webauthn-roaming`,`webauthn-platform`],t=30;async function n(n,r,i,a){if(!a)return{show:!1};let{connections:o}=await n.env.data.connections.list(r),s=o.find(e=>e.name===a)??o.find(e=>e.name.toLowerCase()===a.toLowerCase());if(!s?.options||!s.options.passkey_options?.progressive_enrollment_enabled||!s.options.authentication_methods?.passkey?.enabled||(await n.env.data.authenticationMethods.list(r,i)).some(t=>t.confirmed&&e.includes(t.type)))return{show:!1};let c=await n.env.data.users.get(r,i);if(!c)return{show:!1};let l=c.app_metadata||{};if(l.passkey_enrollment_opted_out===!0)return{show:!1};if(typeof l.passkey_enrollment_snoozed_at==`string`){let e=new Date(l.passkey_enrollment_snoozed_at),n=new Date(e.getTime()+t*24*60*60*1e3);if(new Date<n)return{show:!1}}return{show:!0}}exports.checkPasskeyNudgeRequired=n;
|