Open yusufmalikul opened 2 years ago
Try this:
First, change logHandler
to this:
func logHandler(next http.handler) http.Handler {
// logger
}
It is generally better to use http.Handler
for middlewares instead of http.HandlerFunc
. Handler
is an interface which any router satisfies and helps to chain middlewares better.
Then you can wrap the authboss handler like this:
mux.Mount("/auth", http.StripPrefix("/auth", logHandler(ab.Config.Core.Router)))
I have this part on my code:
How to call
logHandler
for authboss route? I take this from authboss-sample but don't know where to apply the middleware chaining:or it's not possible without modifying the authboss codebase?