Enable CHIPs

This commit is contained in:
2024-06-01 09:44:38 +08:00
parent 2526c4dc6c
commit 329a91e9c0
2 changed files with 11 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ export async function handler(req: Request, ctx: FreshContext) {
t.http_only ? "; HttpOnly" : ""
}${
t.secure
? "; SameSite=None; Secure"
? "; SameSite=None; Secure; Partitioned"
: ""
}; Path=/api`,
);

View File

@@ -67,7 +67,11 @@ export const handler: Handlers = {
if (is_from_auth && is_from_cookie) {
headers["Set-Cookie"] = `token=${token.token}; Max-Age=0${
token.http_only ? "; HttpOnly" : ""
}${token.secure ? "; SameSite=None; Secure" : ""}; Path=/api`;
}${
token.secure
? "; SameSite=None; Secure; Partitioned"
: ""
}; Path=/api`;
}
return return_data(true, 200, headers);
},
@@ -151,7 +155,11 @@ export const handler: Handlers = {
headers["Set-Cookie"] =
`token=${token.token}; Expires=${token.expired.toUTCString()}${
http_only ? "; HttpOnly" : ""
}${secure ? "; SameSite=None; Secure" : ""}; Path=/api`;
}${
secure
? "; SameSite=None; Secure; Partitioned"
: ""
}; Path=/api`;
}
return return_data(token, 201, headers);
},