go-authcrunch
go-authcrunch copied to clipboard
feature: Return error response on auth failure with redirect disabled
Hi @greenpau While using caddy-security, I found this error. https://github.com/greenpau/caddy-security/issues/157#issuecomment-1239083590 So I disabled redirect in caddy security and when I put no token, it returned 500 Internal Server Error. As I checked, this is because of go-authcrunch package. https://github.com/greenpau/go-authcrunch/blob/main/pkg/authz/authenticate.go#L123 Here, if there is an error and redirect is disabled, it sets nothing in response writer. As a result, Caddy caused the internal server error. Can you please make it set some error response if redirect disabled? and release new tag of go-authcrunch and caddy-security? It will be very helpful to me! Thank you