Added middleware to let excluded files skip middleware chain

This commit is contained in:
2025-02-11 19:37:39 +11:00
parent 750de24fd1
commit 97aabcf06f
6 changed files with 75 additions and 9 deletions

View File

@@ -0,0 +1,21 @@
package middleware
import (
"net/http"
"github.com/rs/zerolog"
)
// Take current request
// Get cookies from browser
// Parse the tokens
// Check if tokens blacklisted
// Trigger refresh if required
// Create context with state of user authorization
// Pass request on with context
func Authentication(logger *zerolog.Logger, next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
next.ServeHTTP(w, r)
})
}