From 8fc725639ce1a4c859926bd0db29c8f631ec45ca Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 15 Apr 2024 13:22:46 -1000 Subject: [PATCH] refactor(frontend): :art: Change glitch-soc cookie name to _session_id --- packages/glitch-server/main.ts | 2 +- server/api/api/auth/mastodon-login/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/glitch-server/main.ts b/packages/glitch-server/main.ts index 305187c0..54412126 100644 --- a/packages/glitch-server/main.ts +++ b/packages/glitch-server/main.ts @@ -13,7 +13,7 @@ export const handleGlitchRequest = async ( let path = url.pathname; const accessToken = req.headers .get("Cookie") - ?.match(/_mastodon_session=(.*?)(;|$)/)?.[1]; + ?.match(/_session_id=(.*?)(;|$)/)?.[1]; const user = await retrieveUserFromToken(accessToken ?? ""); // Strip leading /web from path diff --git a/server/api/api/auth/mastodon-login/index.ts b/server/api/api/auth/mastodon-login/index.ts index 3a13f55a..0527b66e 100644 --- a/server/api/api/auth/mastodon-login/index.ts +++ b/server/api/api/auth/mastodon-login/index.ts @@ -67,7 +67,7 @@ export default apiRoute( return new Response(null, { headers: { Location: "/", - "Set-Cookie": `_mastodon_session=${accessToken}; Domain=${ + "Set-Cookie": `_session_id=${accessToken}; Domain=${ new URL(config.http.base_url).hostname }; SameSite=Lax; Path=/; HttpOnly`, },