diff --git a/server/api/api/auth/mastodon-login/index.ts b/server/api/api/auth/mastodon-login/index.ts index 5fede64a..890af817 100644 --- a/server/api/api/auth/mastodon-login/index.ts +++ b/server/api/api/auth/mastodon-login/index.ts @@ -63,13 +63,16 @@ export default apiRoute( userId: user.id, }); + // One week from now + const maxAge = String(60 * 60 * 24 * 7); + // Redirect to home return new Response(null, { headers: { Location: "/", "Set-Cookie": `_session_id=${accessToken}; Domain=${ new URL(config.http.base_url).hostname - }; SameSite=Lax; Path=/; HttpOnly`, + }; SameSite=Lax; Path=/; HttpOnly; Max-Age=${maxAge}`, }, status: 303, });