fix for JWT not being added to auth controller

pull/4/head
AdamSBlack 2021-05-20 22:07:07 +01:00
parent 315fd70098
commit a25992c8f0
1 changed files with 11 additions and 4 deletions

View File

@ -1,12 +1,19 @@
const jwt = require('jsonwebtoken');
async function validateJWT(JWT, Key) {
async function validateJWT(JWT, key) {
try {
return jwt.verify(jwt.replace("JWT ", ""), key, {algorithms: ['RS256']});
} catch (exception) {
// TODO add logger to authentication controller
//logger.error(exception);
}
return null;
}
module.exports = {
validateJWT: validateJWT
}
}