import { type TwoFactorOptions } from "better-auth/plugins"; export type { TwoFactorOptions } from "better-auth/plugins"; /** * Two-Factor 플러그인 스키마 * * better-auth twoFactor 플러그인 호출 시 전달합니다: * ```typescript * twoFactor({ schema: TWO_FACTOR_SCHEMA }) * ``` */ export declare const TWO_FACTOR_SCHEMA: TwoFactorOptions["schema"]; /** * twoFactor 플러그인 래퍼 * * Sonamu의 스키마 매핑을 자동으로 병합합니다. */ export declare const twoFactor: (options?: TwoFactorOptions) => { id: "two-factor"; version: string; endpoints: { enableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/enable", { method: "POST"; body: import("zod").ZodObject<{ password: import("zod").ZodOptional; issuer: import("zod").ZodOptional; }, import("zod/v4/core").$strip> | import("zod").ZodObject<{ password: import("zod").ZodString; issuer: import("zod").ZodOptional; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { totpURI: { type: string; description: string; }; backupCodes: { type: string; items: { type: string; }; description: string; }; }; }; }; }; }; }; }; }; }, { totpURI: string; backupCodes: string[]; }>; disableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/disable", { method: "POST"; body: import("zod").ZodObject<{ password: import("zod").ZodOptional; }, import("zod/v4/core").$strip> | import("zod").ZodObject<{ password: import("zod").ZodString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; }; }; }; }; }; }; }; }; }, { status: boolean; }>; verifyBackupCode: import("better-auth").StrictEndpoint<"/two-factor/verify-backup-code", { method: "POST"; body: import("zod").ZodObject<{ code: import("zod").ZodString; disableSession: import("zod").ZodOptional; trustDevice: import("zod").ZodOptional; }, import("zod/v4/core").$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { type: string; properties: { id: { type: string; description: string; }; email: { type: string; format: string; nullable: boolean; description: string; }; emailVerified: { type: string; nullable: boolean; description: string; }; name: { type: string; nullable: boolean; description: string; }; image: { type: string; format: string; nullable: boolean; description: string; }; twoFactorEnabled: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; }; required: string[]; description: string; }; session: { type: string; properties: { token: { type: string; description: string; }; userId: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; expiresAt: { type: string; format: string; description: string; }; }; required: string[]; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { token: string | undefined; user: (Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }) | import("better-auth/plugins").UserWithTwoFactor; }>; generateBackupCodes: import("better-auth").StrictEndpoint<"/two-factor/generate-backup-codes", { method: "POST"; body: import("zod").ZodObject<{ password: import("zod").ZodOptional; }, import("zod/v4/core").$strip> | import("zod").ZodObject<{ password: import("zod").ZodString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; enum: boolean[]; }; backupCodes: { type: string; items: { type: string; }; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { status: boolean; backupCodes: string[]; }>; viewBackupCodes: import("better-auth").StrictEndpoint; }, import("zod/v4/core").$strip>; }, { status: boolean; backupCodes: string[]; }>; sendTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/send-otp", { method: "POST"; body: import("zod").ZodOptional; }, import("zod/v4/core").$strip>>; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; }; }; }; }; }; }; }; }; }, { status: boolean; }>; verifyTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-otp", { method: "POST"; body: import("zod").ZodObject<{ code: import("zod").ZodString; trustDevice: import("zod").ZodOptional; }, import("zod/v4/core").$strip>; metadata: { openapi: { summary: string; description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; description: string; }; user: { type: string; properties: { id: { type: string; description: string; }; email: { type: string; format: string; nullable: boolean; description: string; }; emailVerified: { type: string; nullable: boolean; description: string; }; name: { type: string; nullable: boolean; description: string; }; image: { type: string; format: string; nullable: boolean; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; }; required: string[]; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { token: string; user: import("better-auth/plugins").UserWithTwoFactor; } | { token: string; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; generateTOTP: import("better-auth").StrictEndpoint; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { code: { type: string; }; }; }; }; }; }; }; }; }; }, { code: string; }>; getTOTPURI: import("better-auth").StrictEndpoint<"/two-factor/get-totp-uri", { method: "POST"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; body: import("zod").ZodObject<{ password: import("zod").ZodOptional; }, import("zod/v4/core").$strip> | import("zod").ZodObject<{ password: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { totpURI: { type: string; }; }; }; }; }; }; }; }; }; }, { totpURI: string; }>; verifyTOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-totp", { method: "POST"; body: import("zod").ZodObject<{ code: import("zod").ZodString; trustDevice: import("zod").ZodOptional; }, import("zod/v4/core").$strip>; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; }; }; }; }; }; }; }; }; }, { token: string; user: import("better-auth/plugins").UserWithTwoFactor; } | { token: string; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }; options: NoInfer; hooks: { after: { matcher(context: import("better-auth").HookEndpointContext): boolean; handler: (inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ twoFactorRedirect: boolean; } | undefined>; }[]; }; schema: { user: { fields: { twoFactorEnabled: { type: "boolean"; required: false; defaultValue: false; input: false; }; }; }; twoFactor: { fields: { secret: { type: "string"; required: true; returned: false; index: true; }; backupCodes: { type: "string"; required: true; returned: false; }; userId: { type: "string"; required: true; returned: false; references: { model: string; field: string; }; index: true; }; }; }; }; rateLimit: { pathMatcher(path: string): boolean; window: number; max: number; }[]; $ERROR_CODES: { OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">; OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">; TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">; TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">; BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">; INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">; INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">; TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">; INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">; }; }; //# sourceMappingURL=two-factor.d.ts.map