Created the session controller

This commit is contained in:
2022-12-27 15:05:22 +01:00
parent eee304dc97
commit ec3ca76677

View File

@ -0,0 +1,10 @@
const jwt = require('jsonwebtoken');
const {getToken} = require("./token");
module.exports.validateSession = async (jwtToken) => {
try {
return jwt.verify(jwtToken, getToken());
} catch (e) {
return null;
}
}