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
Middleware support? #406
Comments
Hey @tadasv this will becoming a future release. For now, you can add a function at the top of your controller actions to do these sorts of checks. Something like: package users
type Controller {
// Deps
}
func (c *Controller) Create(w http.ResponseWriter, r *http.Request) {
if !users.Authenticated(w, r) {
return http.Error(w, "forbidden", 400)
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was trying to find find documentation of how to add custom middlewares? An example would be an auth middleware that checks whether user is logged in or not. How would you achieve that with bud?
The text was updated successfully, but these errors were encountered: