Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Return proper response on authorization failures #37

Merged
merged 1 commit into from
May 20, 2024

Conversation

bnord01
Copy link
Contributor

@bnord01 bnord01 commented May 17, 2024

Currently unauthorized requests return an internal server error and the exception (including the stack trace, 68 lines) is logged to the console.

This PR fixes this by returning the proper response and adds some minimal logging.

Raising an HTTPException in the middleware does not return the expected response and the exception including the stack trace is propagated to the console, producing a huge amount of logs.

This explicitly returns the expected response and only logs the reason.
@danny-avila danny-avila merged commit e8d52dc into danny-avila:main May 20, 2024
@danny-avila
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants