refactor(frontend): 🎨 Change glitch-soc cookie name to _session_id

This commit is contained in:
Jesse Wierzbinski 2024-04-15 13:22:46 -10:00
parent 866cd4345d
commit 8fc725639c
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ export const handleGlitchRequest = async (
let path = url.pathname; let path = url.pathname;
const accessToken = req.headers const accessToken = req.headers
.get("Cookie") .get("Cookie")
?.match(/_mastodon_session=(.*?)(;|$)/)?.[1]; ?.match(/_session_id=(.*?)(;|$)/)?.[1];
const user = await retrieveUserFromToken(accessToken ?? ""); const user = await retrieveUserFromToken(accessToken ?? "");
// Strip leading /web from path // Strip leading /web from path

View file

@ -67,7 +67,7 @@ export default apiRoute<typeof meta, typeof schema>(
return new Response(null, { return new Response(null, {
headers: { headers: {
Location: "/", Location: "/",
"Set-Cookie": `_mastodon_session=${accessToken}; Domain=${ "Set-Cookie": `_session_id=${accessToken}; Domain=${
new URL(config.http.base_url).hostname new URL(config.http.base_url).hostname
}; SameSite=Lax; Path=/; HttpOnly`, }; SameSite=Lax; Path=/; HttpOnly`,
}, },