diff --git a/docs/securing-unleash.md b/docs/securing-unleash.md index 5dbc954adf3b..c8e69aed7655 100644 --- a/docs/securing-unleash.md +++ b/docs/securing-unleash.md @@ -20,7 +20,6 @@ unleash.start({ }).then(unleash => { console.log(`Unleash started on http://localhost:${unleash.app.get('port')}`); }); - ``` Examples on custom authentication hooks: @@ -42,7 +41,7 @@ UnleashConfig unleashConfig = UnleashConfig.builder() .build(); ``` -On the unleash server side you need to implement a preRouterHook hook which verifies that all calls to `/api/client` includes this pre shared key in the defined header. This could look something like this: +On the unleash server side you need to implement a preRouter hook which verifies that all calls to `/api/client` includes this pre shared key in the defined header. This could look something like this: ```javascript const unleash = require('unleash-server'); diff --git a/examples/client-auth-unleash.js b/examples/client-auth-unleash.js index 13ad5b741eb6..743d547f691c 100644 --- a/examples/client-auth-unleash.js +++ b/examples/client-auth-unleash.js @@ -9,7 +9,10 @@ const sharedSecret = '12312Random'; unleash .start({ databaseUrl: 'postgres://unleash_user:passord@localhost:5432/unleash', +<<<<<<< HEAD enableLegacyRoutes: false, +======= +>>>>>>> 0681945... Document how to secure client api #231 preRouterHook: app => { app.use('/api/client', (req, res, next) => { if (req.headers.authorization === sharedSecret) {