Skip to content

Commit

Permalink
added expires in 365d
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishektiwari47 committed Dec 4, 2023
1 parent c55f973 commit 29b75f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/server/dist/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ router.post('/login', (req, res) => __awaiter(void 0, void 0, void 0, function*
const { username, password } = req.body;
const user = yield db_1.User.findOne({ username, password });
if (user) {
const token = jsonwebtoken_1.default.sign({ id: user._id }, index_1.SECRET, {});
const token = jsonwebtoken_1.default.sign({ id: user._id }, index_1.SECRET, { expiresIn: '365d' });
res.json({ message: 'Logged in successfully', token });
}
else {
Expand Down

0 comments on commit 29b75f2

Please sign in to comment.