UNPKG

svelte-guardian

Version:

Batteries included authentication for SvelteKit applications.

33 lines (32 loc) 1.48 kB
import type { EmailVerificationOptions, PasswordResetOptions, TwoFactorAuthOptions } from './index'; interface ApiResponse { success: boolean; error?: string; data?: unknown; } export declare const emailVerification: { requestOTP(email: string): Promise<ApiResponse>; verifyOTP(email: string, otp: string): Promise<ApiResponse>; requestMagicLink(email: string): Promise<ApiResponse>; verifyMagicLink(token: string): Promise<ApiResponse>; handleEmailVerification(email: string, method: EmailVerificationOptions["method"]): Promise<ApiResponse>; }; export declare const passwordReset: { requestReset(email: string): Promise<ApiResponse>; validateToken(token: string): Promise<ApiResponse>; resetPassword(email: string, token: string, newPassword: string, confirmPassword: string): Promise<ApiResponse>; validatePassword(password: string, options?: PasswordResetOptions): { valid: boolean; errors: string[]; }; handlePasswordReset(email: string): Promise<ApiResponse>; }; export declare const twoFactorAuth: { setup(method: TwoFactorAuthOptions["method"]): Promise<ApiResponse>; generateQRCode(secret: string): Promise<string>; verifyToken(token: string): Promise<ApiResponse>; verifyBackupCode(code: string): Promise<ApiResponse>; disable(): Promise<ApiResponse>; handleSetup(method: TwoFactorAuthOptions["method"]): Promise<ApiResponse>; }; export * from '@auth/sveltekit/client';