refactor: standardize session cookie configuration

Centralize cookie security options to dynamically detect HTTPS, ensure secure transport, and update client-side auth handlers to use explicit credential inclusion for cookie-based sessions.
This commit is contained in:
Team Dark Devil committed 2026-11-16 22:12:48 +06:00
1 parent fde2c86b1e
commit b42029f67d
8 files changed
+80 -53

No files matched your search

+5 -3
View File
@@ -64,10 +64,12 @@ export const Sidebar: React.FC<SidebarProps> = ({
setIsSigningOut(true);
setSignOutError('');
try {
const response = await fetch('/api/auth/logout', { method: 'POST' });
const response = await fetch('/api/auth/logout', {
method: 'POST',
credentials: 'include',
});
if (!response.ok) throw new Error('Unable to sign out. Please try again.');
router.replace('/vcon/login');
router.refresh();
window.location.assign('/vcon/login');
} catch (error) {
setSignOutError(
error instanceof Error ? error.message : 'Unable to sign out. Please try again.',