aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/authentication
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-02-06 02:29:07 -0800
committerFuwn <[email protected]>2024-02-06 02:29:07 -0800
commitd1be3ef67a4e403dc9ee76d97b156eda57adafff (patch)
tree4306fe316cb9322317ef0cd1feb016f2eb533b91 /src/routes/api/authentication
parentfeat(layout): remove stores using localstorage (diff)
downloaddue.moe-d1be3ef67a4e403dc9ee76d97b156eda57adafff.tar.xz
due.moe-d1be3ef67a4e403dc9ee76d97b156eda57adafff.zip
feat: stronger logout
Diffstat (limited to 'src/routes/api/authentication')
-rw-r--r--src/routes/api/authentication/log-out/+server.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/routes/api/authentication/log-out/+server.ts b/src/routes/api/authentication/log-out/+server.ts
index 22ef49d8..e3ce347a 100644
--- a/src/routes/api/authentication/log-out/+server.ts
+++ b/src/routes/api/authentication/log-out/+server.ts
@@ -1,7 +1,15 @@
+import root from '$lib/Utility/root.js';
import { redirect } from '@sveltejs/kit';
export const GET = ({ cookies }) => {
cookies.delete('user', { path: '/' });
+ cookies.set('logout', '1', {
+ path: '/',
+ maxAge: 60 * 60 * 24 * 7,
+ httpOnly: false,
+ sameSite: 'lax',
+ secure: false
+ });
- throw redirect(303, '/');
+ throw redirect(303, root('/'));
};