From 59841adf9c30df74197fd075b194cf652c894c55 Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Fri, 6 Nov 2026 21:27:31 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20types(auth):=20E-Mail-R=C3=BCckfall?= =?UTF-8?q?ebene=20und=20gemerkte=20Ger=C3=A4te?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `AdminMfaChallenge` trägt `mfaEnrollmentRecommended` und `rememberDeviceDays`. - `AdminMfaStatus.emailFallback` markiert die erzwungene Rückfallebene. - `AdminTrustedDevice`/`AdminTrustedDevices` für die Geräteliste. - `AdminAuthMethod` kennt `trusted_device` und `impersonation`; `AdminMfaMethod` schließt beide aus. --- index.d.ts | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 9843beb..aeb6a1c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2486,10 +2486,17 @@ declare global { // admin UI and any client use the same contract as the server. /** Every method that can appear in the `amr` claim, including the password. */ - export type AdminAuthMethod = "pwd" | "totp" | "recovery" | "email" | "webauthn" + export type AdminAuthMethod = + | "pwd" + | "totp" + | "recovery" + | "email" + | "webauthn" + | "trusted_device" + | "impersonation" - /** Factors the login offer can contain (no password). */ - export type AdminMfaMethod = Exclude + /** Factors the login offer can contain (no password, no session markers). */ + export type AdminMfaMethod = Exclude /** Step-1 answer when a second factor is required. */ export interface AdminMfaChallenge { @@ -2501,6 +2508,10 @@ declare global { methods: AdminMfaMethod[] /** Masked address when the e-mail factor is one of the methods. */ emailHint?: string + /** A real factor is still worthwhile (e-mail fallback relieved the login). */ + mfaEnrollmentRecommended?: boolean + /** >0 when the server allows remembering this browser after the factor. */ + rememberDeviceDays?: number } /** Step-1 answer for an account without an active factor. */ @@ -2523,11 +2534,28 @@ declare global { /** Masked verified address, e.g. `a***@example.com`. */ email?: string emailVerified: boolean + /** Server forces an e-mail code although no factor is enrolled. */ + emailFallback: boolean recoveryCodesRemaining: number enforced: boolean policy: "off" | "optional" | "required" } + /** One browser that skips the login challenge. */ + export interface AdminTrustedDevice { + id: string + label: string + createdAt: string + lastUsedAt?: string + expiresAt: string + } + + export interface AdminTrustedDevices { + enabled: boolean + days: number + devices: AdminTrustedDevice[] + } + export interface AdminMfaTotpEnrollment { secret: string otpauthUri: string