Update auth-utils.ts
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user