fix for JWT not being added to auth controller
parent
315fd70098
commit
a25992c8f0
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue