cookies are now based

This commit is contained in:
amy 2024-12-03 17:44:29 +03:30
parent 5846e35e81
commit b230d56dab
Signed by: amy
SSH key fingerprint: SHA256:Y6VEv6ZOxI6zqjjOF4luhfaCoY+zDK0w62P+qhQYie4

View file

@ -17,6 +17,11 @@ if (!process.env.ADMINS) {
process.exit(1);
}
if (!process.env.ORIGIN_BASEDOMAIN) {
console.error("no origin base domain found");
process.exit(1);
}
if (!process.env.ORIGIN) {
console.error("no origin found");
process.exit(1);
@ -108,7 +113,11 @@ fastify.get('/login/callback', async function (request, reply) {
},
})
}
reply.setCookie('access_token', refreshToken.access_token);
reply.setCookie('access_token', refreshToken.access_token, {
domain: process.env.ORIGIN_BASEDOMAIN,
path: '/',
maxAge: 31_622_400,
});
return reply.send({access_token: refreshToken.access_token});
});