chore(webui): refactor session routing

This commit is contained in:
Julien Dessaux 2025-04-23 00:15:04 +02:00
parent 4722efb73d
commit 342e1d6328
Signed by: adyxax
GPG key ID: F92E51B86E07177E
2 changed files with 6 additions and 6 deletions

View file

@ -97,9 +97,9 @@ func handleLoginPOST(db *database.DB) http.Handler {
})
}
func loginMiddleware(db *database.DB, requireSession func(http.Handler) http.Handler) func(http.Handler) http.Handler {
func loginMiddleware(db *database.DB, processSession func(http.Handler) http.Handler) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return requireSession(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
return processSession(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-store, no-cache")
session := r.Context().Value(model.SessionContextKey{})
if session == nil {