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 token - The authentication token. * @param expires - Expiration timestamp of the token. * @returns `true` if the session is valid, otherwise `false`. */ export declare const validateSession: (strategy: string | null, token: string | null, expires: string | null) => 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 that the auth plugin is initialized and returns the auth instance. * @throws An error if the auth plugin is not initialized. */ export declare const validateAuthPlugin: () => { $auth: any; }; /** * Extracts authentication data from cookies on the server side. * @param $auth - The auth instance. * @param tokenSuffix - The token suffix (e.g., 'token', '2fa'). * @returns Object containing strategy, token, and expiration. */ export declare const extractServerAuthData: ($auth: AuthInstance, tokenSuffix: string) => { strategy: any; token: any; expires: any; }; /** * Extracts authentication data from localStorage on the client side. * @param $auth - The auth instance. * @param tokenSuffix - The token suffix (e.g., 'token', '2fa'). * @returns Object containing strategy, token, and expiration. */ export declare const extractClientAuthData: ($auth: AuthInstance, tokenSuffix: string) => { strategy: string | null; token: string | null; expires: string | null; }; /** * Validates user authentication state on the client side. * @param $auth - The auth instance. * @param store - The auth store instance. * @returns True if user is authenticated, false otherwise. */ export declare const validateUserAuthState: ($auth: AuthInstance, store: Ref) => boolean; /** * Validates strategy consistency between auth and store. * @param $auth - The auth instance. * @param store - The auth store instance. * @param currentStrategy - The current strategy being validated. * @returns True if strategies are consistent, false otherwise. */ export declare const validateStrategyConsistency: ($auth: AuthInstance, store: Ref, currentStrategy: string) => boolean;