aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/logout/index.js
diff options
context:
space:
mode:
authorsecondl1ght <[email protected]>2022-07-30 13:01:35 -0600
committersecondl1ght <[email protected]>2022-07-30 13:01:35 -0600
commit7b2050102eb01fe3a694a60b0111262eacef735f (patch)
tree0d0f4070fd763885ee605cdac9baf1d491bac3a6 /src/routes/logout/index.js
parente599c7dec8b79903b769f957231c67e16dde9bfc (diff)
parentef3bd2f6687d0bfca1b85cc3f4be47c8e628c748 (diff)
downloadcoinos-ui-7b2050102eb01fe3a694a60b0111262eacef735f.tar.gz
coinos-ui-7b2050102eb01fe3a694a60b0111262eacef735f.zip
Merge branch 'master' of github.com:coinos/coinos-ui-v2
Diffstat (limited to 'src/routes/logout/index.js')
-rw-r--r--src/routes/logout/index.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/routes/logout/index.js b/src/routes/logout/index.js
new file mode 100644
index 00000000..80e65f8b
--- /dev/null
+++ b/src/routes/logout/index.js
@@ -0,0 +1,26 @@
+import cookie from "cookie";
+
+const opts = {
+ httpOnly: true,
+ sameSite: "lax",
+ path: "/",
+};
+
+export async function GET({ request: { headers } }) {
+ return {
+ status: 302,
+ headers: {
+ location: "/logout/done",
+ "set-cookie": [
+ cookie.serialize("token", "", {
+ ...opts,
+ expires: new Date(0),
+ }),
+ cookie.serialize("refresh_token", "", {
+ ...opts,
+ expires: new Date(0),
+ }),
+ ],
+ },
+ };
+}