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 = {
|
module.exports = {
|
||||||
validateJWT: validateJWT
|
validateJWT: validateJWT
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue