/** * Hook for managing login redirect flows. * * Provides utilities for: * - Navigating to login with a redirect-after-login path * - Extracting the redirect path from URL query params on the login page * - Handling post-login navigation */ export interface UseLoginRedirectOptions { /** Path to the login page (without language prefix). @default '/login' */ loginPath?: string; /** Where to redirect after login if no ?redirect param is present. @default '/' */ defaultRedirect?: string; /** Current language code for localized navigation */ currentLanguage?: string; } export interface UseLoginRedirectResult { /** The redirect path from ?redirect= query param, or null if not present */ redirectPath: string | null; /** redirectPath if present, otherwise defaultRedirect */ effectiveRedirect: string; /** Navigate to login page, optionally specifying where to redirect after login */ navigateToLogin: (redirectAfterLogin?: string) => void; /** Navigate to effectiveRedirect (call this on login success) */ handleLoginSuccess: () => void; } /** * Hook for login redirect flows. * * On pages that need login: * ```tsx * const { navigateToLogin } = useLoginRedirect({ currentLanguage: lang }); * // navigateToLogin('/profile/subscription') → /en/login?redirect=/profile/subscription * ``` * * On the login page: * ```tsx * const { handleLoginSuccess } = useLoginRedirect({ currentLanguage: lang }); * // After successful auth: * handleLoginSuccess(); // navigates to ?redirect= value or defaultRedirect * ``` */ export declare function useLoginRedirect(options?: UseLoginRedirectOptions): UseLoginRedirectResult; //# sourceMappingURL=useLoginRedirect.d.ts.map