Closed
Description
Couldn't find out any issue with this. I'm trying to hide my swagger-stats behind the authentication. Everything works except the authentication. I've set the authentication param to true and provide the handler for the callback and nothing happens. I'm out of the ideas.
I'm using hapi-swagger 13.0.2, "swagger-stats": "^0.95.17".
return server.register({
plugin: swStats.getHapiPlugin,
options: {
name: "Testing metrics",
version: "1.0",
authentication: true,
onAuthenticate: (req, username, password) => {
console.log("auth!");
return (
username === config.METRICS_USERNAME &&
password === config.METRICS_PASS
);
}
}
});