diff --git a/middleware/authentication/adapters/jwt.js b/middleware/authentication/adapters/jwt.js index 3c20dbce..ba321988 100644 --- a/middleware/authentication/adapters/jwt.js +++ b/middleware/authentication/adapters/jwt.js @@ -21,6 +21,12 @@ module.exports = function(adapterId, adapterType, config) value = req.cookies[config.cookie.toLowerCase()]; } + // Strip Bearer from JWT if exist + if (value.substr(0, 7) === 'Bearer ') + { + value = value.substr(7) + } + if (!value) { return null; @@ -88,4 +94,4 @@ module.exports = function(adapterId, adapterType, config) }; return r; -}; \ No newline at end of file +};