Skip to content

Commit a29bce2

Browse files
author
lucifer
committed
feat: expires
1 parent bd16241 commit a29bce2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routes/users.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ router.get("/", async (ctx) => {
4747
loginedUsers.add(user.login);
4848
}
4949
if (db.find((q) => q.login === user.login)) {
50-
ctx.cookies.set("token", encrypt(JSON.stringify(user)));
50+
ctx.cookies.set("token", encrypt(JSON.stringify(user)), {
51+
httpOnly: false,
52+
expires: 24 * 60 * 60 * 1000 + Date.now(),
53+
});
5154
ctx.body = {
5255
...user,
5356
pay: true,

0 commit comments

Comments
 (0)