commit
This commit is contained in:
parent
cd74f8e71b
commit
d4d7f51d03
6 changed files with 58 additions and 7 deletions
|
@ -13,7 +13,11 @@ router.post('/', async (req, res) => {
|
|||
}
|
||||
|
||||
try {
|
||||
jwt.verify(token, process.env.JWTSecret);
|
||||
const user = jwt.verify(token, process.env.JWTSecret);
|
||||
|
||||
if (user.expiration < Date.now()) {
|
||||
return res.status(400).send({error: "token expired"});
|
||||
}
|
||||
} catch {
|
||||
return res.status(400).send({error: "invalid token"});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue