Skip to content

Hapi - authentication is not working. #109

Closed
@fenrirx22

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

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions