express-openapi-validator icon indicating copy to clipboard operation
express-openapi-validator copied to clipboard

Custom security handlers are not run

Open stevenhair opened this issue 5 years ago • 2 comments

Describe the bug When defining a custom security handler as per the documentation, it is never run.

To Reproduce

  • Add a security condition to a route in the OpenAPI specification
  • Define a custom handler
  • Access the route without meeting the security condition (e.g. without the cookie)

Actual behavior The response is sent with the default status code and error message.

Expected behavior The response should be sent with the custom status code and error message defined in the handler.

Examples and context Here is a reproduction repository: https://github.com/stevenhair/friendly-waffle

stevenhair avatar Feb 19 '21 02:02 stevenhair

i'm facing the same issue.

shimri-au10tix avatar Apr 04 '21 08:04 shimri-au10tix

Same

patricktyndall avatar Oct 01 '21 16:10 patricktyndall