PaloAltoNetworks / docusaurus-openapi-docs

🦝 OpenAPI plugin for generating API reference docs in Docusaurus v3.
https://docusaurus-openapi.tryingpan.dev
MIT License
661 stars 227 forks source link

401 Unauthorized ignored #732

Open andreazerbini opened 6 months ago

andreazerbini commented 6 months ago

Describe the bug

Attempting to access to an endpoint that require bearer token, if BE responds with a 401 status, the UI doesn't show any information of that problem. It seems that nothing had happened.

Expected behavior

Expected behavior: the user is informed that bearer token is not authorized to access to that endpoint.

Current behavior

Current behavior: nothing had happened.

Steps to reproduce

Sending a request without a valid token to an endpoint that requires a bearer token.

Screenshots

d9f88ea1-4af6-4877-be1b-9602ba9d31f3

Your Environment

sserrata commented 3 months ago

Hi @andreazerbini, are you certain the requests aren't also getting blocked by CORS?

andreazerbini commented 2 months ago

Hi @sserrata yes we are certain because CORS error is not reported as 401. Furthermore, if we correctly insert the Authorization bearer header it works correctly, instead if it had been a "CORS problem" it would have continued to give a CORS error. If you need some other details le me know. Thank you so much. Ps. if you need a mocked DTO of request and response let me know.

ashrafchowdury commented 1 month ago

I'm also facing this issue, is there anything specific we have to do which are not mentioned in the instructions?