···11import type { GetProfileResponse } from '@/api-client/ApiClient';
22import { cache } from 'react';
33+import { ClientCookieAuthService } from '@/services/auth/CookieAuthService.client';
3445const appUrl = process.env.NEXT_PUBLIC_APP_URL || 'http://127.0.0.1:4000';
56···4849 return refreshPromise;
4950 },
5051);
5252+5353+/**
5454+ * Logs out the current user by clearing tokens and redirecting to login
5555+ * Can be called from both client and server contexts
5656+ */
5757+export const logoutUser = async (): Promise<void> => {
5858+ await ClientCookieAuthService.clearTokens();
5959+ if (typeof window !== 'undefined') {
6060+ window.location.href = '/login';
6161+ }
6262+};