Open tadasv opened 1 year ago
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)
}
}
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?