Update auth-utils.ts

This commit is contained in:
NotII
2025-03-23 23:03:54 +00:00
parent 08fb0c4470
commit 259898cef0

View File

@@ -27,7 +27,6 @@ export async function logoutUser(): Promise<void> {
if (token) {
try {
// Try to logout on the server (if this fails, we still proceed with client logout)
await fetch(`${process.env.NEXT_PUBLIC_API_URL}/auth/logout`, {
method: 'POST',
headers: {
@@ -35,12 +34,10 @@ export async function logoutUser(): Promise<void> {
'Content-Type': 'application/json'
}
}).catch(err => {
// Silently catch errors - we still want to proceed with local logout
console.warn('Server logout failed:', err);
});
} catch (error) {
console.warn('Error during server logout:', error);
// Continue with client-side logout regardless of server response
}
}