import type { Ref } from 'vue'; import type { AuthInstance, AuthState } from '#auth-types'; /** * Handles user logout by clearing session data and redirecting. * @param strategy - The authentication strategy to log out from. * @param redirectPath - The path to redirect after logout. * @param middleware - The middleware type, defaults to "auth". * @throws An error if called on the server side. */ export declare const handleLogout: (strategy: string | null, redirectPath: string, middleware?: string) => Promise; /** * Validates an authentication session based on token and expiration time. * @param strategy - The authentication strategy in use. * @param session - The authentication token. * @param xsrf - Expiration timestamp of the token. * @param isServer - Whether the validation is happening on the server side. * @returns `true` if the session is valid, otherwise `false`. */ export declare const validateSession: (strategy: string | null, session: string | null, xsrf: string | null, isServer: boolean) => boolean; /** * Validates an authentication session based on token and expiration time. * @param strategy - The authentication strategy in use. * @param token - The authentication token. * @param expires - Expiration timestamp of the token. * @param isServer - Whether the validation is happening on the server side. * @returns `true` if the session is valid, otherwise `false`. */ export declare const validateSessionHas2FA: (strategy: string | null, token: string | null, expires: string | null, isServer: boolean) => boolean; /** * Retrieves the appropriate redirect path based on the authentication strategy. * @param strategy - The authentication strategy in use. * @returns The redirect path for login, callback, or home, defaults to `/` if none is found. */ export declare const getRedirectPath: (strategy: string | null) => string; /** * Validates if the auth plugin is properly initialized. * @param $auth - The auth plugin instance. * @throws An error if the auth plugin is not initialized. */ export declare const validateAuthPlugin: ($auth: AuthInstance) => void; /** * Gets the current authentication strategy from cookies. * @param $auth - The auth plugin instance. * @returns The strategy name or null if not found. */ export declare const getCurrentStrategy: ($auth: AuthInstance) => string | null; /** * Sets XSRF token in auth headers if available. * @param $auth - The auth plugin instance. */ export declare const setXSRFHeaders: ($auth: AuthInstance) => void; /** * Validates the final auth state on client side. * @param $auth - The auth plugin instance. * @param store - The auth store instance. * @returns True if auth state is valid, false otherwise. */ export declare const validateClientAuthState: ($auth: AuthInstance, store: Ref) => boolean; /** * Gets the request event for server-side processing. * @returns The request event or null if not available. */ export declare const getRequestEvent: () => any;