aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/authentication/log-out
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-14 12:52:26 -0800
committerFuwn <[email protected]>2023-12-14 12:52:26 -0800
commitc4267cce67e7de6dea2277ce07b6f9a22d8ca674 (patch)
treec1279a47204ea7359937b469f61e48deb3c64747 /src/routes/api/authentication/log-out
parentstyle(stores): simplify statements (diff)
downloaddue.moe-c4267cce67e7de6dea2277ce07b6f9a22d8ca674.tar.xz
due.moe-c4267cce67e7de6dea2277ce07b6f9a22d8ca674.zip
feat(api): nest routes
Diffstat (limited to 'src/routes/api/authentication/log-out')
-rw-r--r--src/routes/api/authentication/log-out/+server.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/routes/api/authentication/log-out/+server.ts b/src/routes/api/authentication/log-out/+server.ts
new file mode 100644
index 00000000..22ef49d8
--- /dev/null
+++ b/src/routes/api/authentication/log-out/+server.ts
@@ -0,0 +1,7 @@
+import { redirect } from '@sveltejs/kit';
+
+export const GET = ({ cookies }) => {
+ cookies.delete('user', { path: '/' });
+
+ throw redirect(303, '/');
+};