From 0076135b3926c70f648e284de8f642ae2f612d29 Mon Sep 17 00:00:00 2001 From: Viktor Bergehall Date: Mon, 12 Feb 2018 11:57:39 +0100 Subject: [PATCH 1/2] Remove Bearer from JWT if exist --- middleware/authentication/adapters/jwt.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 +}; From c187bce98e7946d389f0c7363ca7e4d0e71176f2 Mon Sep 17 00:00:00 2001 From: Viktor Bergehall Date: Mon, 12 Feb 2018 12:02:58 +0100 Subject: [PATCH 2/2] Update jwt.js