change logout to 30 days

This commit is contained in:
chris 2025-08-08 10:47:41 -04:00
parent d2e50dccd1
commit d30c0921cf

View File

@ -111,7 +111,7 @@ function setupRoutes() {
const isMatch = await bcrypt.compare(password, user.password); const isMatch = await bcrypt.compare(password, user.password);
if (!isMatch) return res.status(401).json({ message: "Invalid credentials." }); if (!isMatch) return res.status(401).json({ message: "Invalid credentials." });
const tokenPayload = { id: user.id, username: user.username, role: user.role }; const tokenPayload = { id: user.id, username: user.username, role: user.role };
const token = jwt.sign(tokenPayload, JWT_SECRET, { expiresIn: '8h' }); const token = jwt.sign(tokenPayload, JWT_SECRET, { expiresIn: '30d' });
res.json({ token, user: tokenPayload }); res.json({ token, user: tokenPayload });
} catch (err) { } catch (err) {
res.status(500).json({ message: "Server error during login." }); res.status(500).json({ message: "Server error during login." });