feat(auth): oturum süresini 60 güne uzat

This commit is contained in:
2026-01-03 20:23:38 +03:00
parent 0665a7de1e
commit 90732e06ef
2 changed files with 7 additions and 2 deletions

View File

@@ -26,12 +26,17 @@ router.post("/login", loginLimiter, async (req, res) => {
httpOnly: true,
sameSite: "lax",
secure: !isDev,
maxAge: 60 * 24 * 60 * 60 * 1000,
});
return res.json({ username: user.username });
});
router.post("/logout", (_req, res) => {
res.clearCookie("qbuffer_token");
res.clearCookie("qbuffer_token", {
httpOnly: true,
sameSite: "lax",
secure: !isDev,
});
return res.json({ ok: true });
});

View File

@@ -40,7 +40,7 @@ export const verifyCredentials = async (username: string, password: string) => {
};
export const signToken = (payload: { username: string }) => {
return jwt.sign(payload, config.jwtSecret, { expiresIn: "7d" });
return jwt.sign(payload, config.jwtSecret, { expiresIn: "60d" });
};
export const verifyToken = (token: string) => {