From c580a50e8fb6bf6cb0568fb602978b0c9187167a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Sat, 21 Jul 2018 09:52:53 +0200 Subject: [PATCH] Update client-auth-unleash.js --- examples/client-auth-unleash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/client-auth-unleash.js b/examples/client-auth-unleash.js index 2502dc8eb1..237decdb48 100644 --- a/examples/client-auth-unleash.js +++ b/examples/client-auth-unleash.js @@ -12,10 +12,10 @@ unleash enableLegacyRoutes: false, preRouterHook: app => { app.use('/api/client', (req, res, next) => { - if (req.header('authorization') !== sharedSecret) { - res.sendStatus(401); - } else { + if (req.header('authorization') === sharedSecret) { next(); + } else { + res.sendStatus(401); } }); },