logout secure

This commit is contained in:
Randa Firman Putra
2025-12-08 02:01:25 +07:00
parent 7a181be69b
commit 781a7c1be3
2 changed files with 7 additions and 5 deletions

View File

@@ -7,12 +7,12 @@ export async function POST() {
// Clear the session cookie
response.cookies.set('user_session', '', {
httpOnly: true,
secure: process.env.NODE_ENV === 'production',
httpOnly: true,
secure: false, // Set to false to allow HTTP (for Coolify deployment)
sameSite: 'lax',
maxAge: 0, // Expire immediately
path: '/',
});
});
return response;
}