Add authentication middleware

This commit is contained in:
Achim Rohn
2025-09-17 17:32:50 +02:00
parent 8bc7b1e27b
commit 667345bc9e
5 changed files with 291 additions and 12 deletions
+3 -1
View File
@@ -31,8 +31,10 @@ func MakeGzipHandler(fn http.Handler) http.Handler {
})
}
type MiddlewareFunc func(next http.Handler) http.Handler
// https://www.jvt.me/posts/2023/09/01/golang-nethttp-global-middleware/
func UseMiddleware(r HtmxServer, middlewares ...func(next http.Handler) http.Handler) http.Handler {
func UseMiddleware(r HtmxServer, middlewares ...MiddlewareFunc) http.Handler {
var s http.Handler
s = r.GetHttpServer()