From e2c410822ad8aea8ec702cef6bba5de352b8c73d Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 14 Nov 2024 13:44:33 +0000 Subject: everything expires in 5 days --- src/routes/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/routes/index.js b/src/routes/index.js index f5d679c..1141009 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -150,12 +150,12 @@ router.post("/register", async (req, res) => { hashedPassword, }); const id = insertedRecord.lastInsertRowid; - const token = jwt.sign({ username, id }, JWT_KEY, { expiresIn: "100h" }); + const token = jwt.sign({ username, id }, JWT_KEY, { expiresIn: "5d" }); res .status(200) .cookie("auth_token", token, { httpOnly: true, - maxAge: 2 * 24 * 60 * 60 * 1000, + maxAge: 5 * 24 * 60 * 60 * 1000, }) .redirect("/"); } catch (err) { @@ -177,12 +177,12 @@ router.post("/login", async (req, res) => { .get({ username }); if (user && (await Bun.password.verify(password, user.password_hash))) { const token = jwt.sign({ username, id: user.id }, JWT_KEY, { - expiresIn: "1h", + expiresIn: "5d", }); res .cookie("auth_token", token, { httpOnly: true, - maxAge: 2 * 24 * 60 * 60 * 1000, + maxAge: 5 * 24 * 60 * 60 * 1000, }) .redirect(req.query.redirect || "/"); } else { -- cgit v1.2.3