cookies are now based
This commit is contained in:
parent
5846e35e81
commit
b230d56dab
1 changed files with 10 additions and 1 deletions
11
src/main.ts
11
src/main.ts
|
@ -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});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue