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); } }); },