mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-23 08:14:28 +01:00
29 lines
714 B
JavaScript
29 lines
714 B
JavaScript
|
|
const cookie = require('cookie')
|
|
|
|
exports.handler = async (event, context) => {
|
|
// const hour = 3600000
|
|
// const maxAge = 30 * 24 * hour;
|
|
// const _cookie = cookie.serialize('Hello', `Bearer hello`, {
|
|
// // secure: true,
|
|
// // httpOnly: true,
|
|
// path: '/',
|
|
// maxAge
|
|
// })
|
|
const hour = 3600000
|
|
const twoWeeks = 14 * 24 * hour
|
|
const myCookie = cookie.serialize('Authorization', '', {
|
|
secure: true,
|
|
httpOnly: true,
|
|
path: '/',
|
|
maxAge: -1,
|
|
})
|
|
console.log(myCookie);
|
|
return {
|
|
status: 'OK',
|
|
'headers': {
|
|
'Set-Cookie': myCookie,
|
|
'Cache-Control': 'no-cache',
|
|
}
|
|
}
|
|
}; |