Fix Cookie's Path may not correct

This commit is contained in:
2023-08-15 11:19:53 +08:00
parent af5667f337
commit 004942ab22
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ export async function handler(req: Request, ctx: MiddlewareHandlerContext) {
"Set-Cookie",
`token=${t.token}; Expires=${t.expired.toUTCString()}${
t.http_only ? "; HttpOnly" : ""
}${t.secure ? "; Secure" : ""}`,
}${t.secure ? "; Secure" : ""}; Path=/api`,
);
} catch {
null;

View File

@@ -75,7 +75,7 @@ export const handler: Handlers = {
headers["Set-Cookie"] =
`token=${token.token}; Expires=${token.expired.toUTCString()}${
http_only ? "; HttpOnly" : ""
}${secure ? "; Secure" : ""}`;
}${secure ? "; Secure" : ""}; Path=/api`;
}
return return_data(token, 201, headers);
},