draft seasons get special treatment :)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user