Update: Prettify token expiration dates
This commit is contained in:
parent
de57170c35
commit
000a4e0054
1 changed files with 3 additions and 0 deletions
|
|
@ -82,6 +82,9 @@ function checkLogin(req, res, role=null){
|
|||
if(typeof token.email === 'undefined' || typeof token.email === 'undefined'){
|
||||
return sendError(res, 500, 102, "User not authenticated.");
|
||||
} else {
|
||||
token.midExp = new Date(token.midExp*1000);
|
||||
token.iat = new Date(token.iat*1000);
|
||||
token.exp = new Date(token.exp*1000);
|
||||
if(role === null){
|
||||
return token;
|
||||
} else {
|
||||
|
|
|
|||
Reference in a new issue