draft seasons get special treatment :)

This commit is contained in:
2026-02-18 20:36:15 +11:00
parent 25a2109d1e
commit 59748b9bb9
16 changed files with 416 additions and 78 deletions

View File

@@ -2,6 +2,7 @@ package rbac
import (
"context"
"fmt"
"net/http"
"strconv"
@@ -28,8 +29,11 @@ func LoadPreviewRoleMiddleware(s *hws.Server, conn *db.DB) func(http.Handler) ht
user := db.CurrentUser(r.Context())
if user == nil {
// User not logged in,
ClearPreviewRoleCookie(w)
fmt.Println(user)
// User not logged in
// Auth middleware skips on certain routes like CSS files so even
// if user IS logged in, this will trigger on those routes,
// so we just pass the request on and do nothing.
next.ServeHTTP(w, r)
return
}