Skip to content

Commit 98bfeef

Browse files
committed
fix raiseUnauthorized to avoid doubled descriptions
1 parent ef0d68b commit 98bfeef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function verify (opts) {
118118
function raiseUnauthorized (err, msg, reason, scheme = 'Bearer') {
119119
return boom.unauthorized(err ? err.message : msg, scheme, {
120120
strategy: 'keycloak-jwt',
121-
...(reason ? { reason } : {})
121+
...(reason && !err ? { reason } : {})
122122
})
123123
}
124124

0 commit comments

Comments
 (0)