1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-03-02 02:31:35 +00:00

Work around cookie max-age bug in Epiphany

This commit is contained in:
Cadence Ember 2023-03-06 00:06:09 +13:00
parent 9f7b1bbcae
commit cfa04f4a27
2 changed files with 4 additions and 4 deletions

View file

@ -24,7 +24,7 @@ function getToken(req, responseHeaders) {
function setToken(responseHeaders, token) {
const setCookie = responseHeaders["set-cookie"] || []
if (!token) token = crypto.randomBytes(18).toString("base64").replace(/\W/g, "_")
setCookie.push(`token=${token}; Path=/; Max-Age=2147483648; HttpOnly; SameSite=Lax`)
setCookie.push(`token=${token}; Path=/; Max-Age=2147483647; HttpOnly; SameSite=Lax`)
responseHeaders["set-cookie"] = setCookie
return {token, responseHeaders}
}