Hi there is a need to pass a json object to check authentication in each request
for this purpose i am using gorilla package
func middlewareFirstAuthCheck(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Println("middlewareFirstAuthCheck - Before Handler")
next.ServeHTTP(w, r)
})
}
func StandartHandler(w http.ResponseWriter, r *http.Request) {
}
in standard handler i accept json object, and in middlewareFirstAuthCheck i accept different json object
middlewareFirstAuthCheck is executed first
there is an understanding of what needs to be done, but how to implement it correctly?