diff --git a/handlers.go b/handlers.go index d74f1ca..bb1b47d 100644 --- a/handlers.go +++ b/handlers.go @@ -468,9 +468,9 @@ func (s *Server) authorizeAdmin(w http.ResponseWriter, r *http.Request, isPage b return nil } - if s.features.Auth { + if s.features.Auth && event.UserID.Valid { user := s.currentUser(r) - if user == nil || !event.UserID.Valid || user.ID != event.UserID.Int64 { + if user == nil || user.ID != event.UserID.Int64 { if isPage { http.Redirect(w, r, "/e/"+slug, http.StatusSeeOther) } else {