Skip to content

Commit

Permalink
Update authController.js
Browse files Browse the repository at this point in the history
extended jwt token life span
  • Loading branch information
TheMohit2003 authored Feb 21, 2024
1 parent 5b39b3c commit 687e26e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const register = async (req, res) => {
const token = jsonwebtoken.sign(
{ userId: user.id, email: user.email },
JWT_SECRET,
{ expiresIn: '1h' }
{ expiresIn: '6h' }
);
res.status(201).json({ token });
} catch (error) {
Expand Down Expand Up @@ -69,7 +69,7 @@ const login = async (req, res) => {
const token = jsonwebtoken.sign(
{ userId: user.id, email: user.email, role: user.role },
JWT_SECRET,
{ expiresIn: '1h' }
{ expiresIn: '6h' }
);
res.status(200).json({ token });
};
Expand Down

0 comments on commit 687e26e

Please sign in to comment.