fix(frontend): 🎨 Make the glitch-soc session cookie last a week instead of for the session

This commit is contained in:
Jesse Wierzbinski 2024-04-15 20:09:38 -10:00
parent 245d4844f5
commit 94f9586592
No known key found for this signature in database

View file

@ -63,13 +63,16 @@ export default apiRoute<typeof meta, typeof schema>(
userId: user.id, userId: user.id,
}); });
// One week from now
const maxAge = String(60 * 60 * 24 * 7);
// Redirect to home // Redirect to home
return new Response(null, { return new Response(null, {
headers: { headers: {
Location: "/", Location: "/",
"Set-Cookie": `_session_id=${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; Max-Age=${maxAge}`,
}, },
status: 303, status: 303,
}); });