aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/logout
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/logout')
-rw-r--r--src/routes/logout/+server.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/routes/logout/+server.ts b/src/routes/logout/+server.ts
new file mode 100644
index 0000000..4880c2a
--- /dev/null
+++ b/src/routes/logout/+server.ts
@@ -0,0 +1,14 @@
+import { base } from '$app/paths';
+import { redirect } from '@sveltejs/kit';
+
+export const GET = (event) =>
+ redirect(
+ 307,
+ `${base}/login/undo${
+ event.url.searchParams.get('next')
+ ? `?next=${encodeURIComponent(
+ event.url.searchParams.get('next') ?? '/'
+ )}`
+ : ''
+ }`
+ );