-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Small correction :
controllers/auth.contoller.js
Expiration should not be set on decode, but on encode instead
const encodeToken = (tokenData) => {
return njwt.create(tokenData, APP_SECRET).setExpiration(new Date().getTime() + 604800000).compact();
}
const decodeToken = (token) => {
return njwt.verify(token, APP_SECRET).body; //1 week
}
Otherwise expiration will not set correctly
Metadata
Metadata
Assignees
Labels
No labels