From 98bfeef082aea54cef7fc71b3e730113f52b42be Mon Sep 17 00:00:00 2001 From: Felix Heck Date: Sun, 28 Jan 2018 15:02:50 +0100 Subject: [PATCH] fix raiseUnauthorized to avoid doubled descriptions --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 58632a6..8b4a568 100644 --- a/src/utils.js +++ b/src/utils.js @@ -118,7 +118,7 @@ function verify (opts) { function raiseUnauthorized (err, msg, reason, scheme = 'Bearer') { return boom.unauthorized(err ? err.message : msg, scheme, { strategy: 'keycloak-jwt', - ...(reason ? { reason } : {}) + ...(reason && !err ? { reason } : {}) }) }