Update: checkLogin
This commit is contained in:
parent
d2194ee9ea
commit
49bef8ec5f
1 changed files with 3 additions and 2 deletions
|
|
@ -81,10 +81,11 @@ function checkLogin(req, res, role=null){
|
||||||
if(typeof req.cookies !== 'undefined'){
|
if(typeof req.cookies !== 'undefined'){
|
||||||
const session = getSession(req.cookies.SESSIONID);
|
const session = getSession(req.cookies.SESSIONID);
|
||||||
const token = getToken(session);
|
const token = getToken(session);
|
||||||
|
console.log(token);
|
||||||
if(typeof token.email === 'undefined' ||
|
if(typeof token.email === 'undefined' ||
|
||||||
typeof token.email === -1 ||
|
token.email === -1 ||
|
||||||
typeof token.id === 'undefined' ||
|
typeof token.id === 'undefined' ||
|
||||||
typeof token.id === -1){
|
token.id === -1){
|
||||||
return sendError(res, 500, 102, "User not authenticated.");
|
return sendError(res, 500, 102, "User not authenticated.");
|
||||||
} else {
|
} else {
|
||||||
token.midExp = new Date(token.midExp*1000);
|
token.midExp = new Date(token.midExp*1000);
|
||||||
|
|
|
||||||
Reference in a new issue