diff --git a/internal/webserver/controller/highlight/highlight.go b/internal/webserver/controller/highlight/highlight.go index 427ab3d..e4220f7 100644 --- a/internal/webserver/controller/highlight/highlight.go +++ b/internal/webserver/controller/highlight/highlight.go @@ -2,16 +2,11 @@ package highlight import ( "github.com/gofiber/fiber/v2" - "github.com/svera/coreander/v3/internal/webserver/jwtclaimsreader" + "github.com/svera/coreander/v3/internal/webserver/model" ) func (h *Controller) Highlight(c *fiber.Ctx) error { - session := jwtclaimsreader.SessionData(c) - - user, err := h.usrRepository.FindByUuid(session.Uuid) - if err != nil { - return fiber.ErrBadRequest - } + user := c.Locals("Session").(model.User) document, err := h.idx.Document(c.FormValue("slug")) if err != nil { diff --git a/internal/webserver/controller/highlight/remove.go b/internal/webserver/controller/highlight/remove.go index 418d99f..672ad78 100644 --- a/internal/webserver/controller/highlight/remove.go +++ b/internal/webserver/controller/highlight/remove.go @@ -2,16 +2,11 @@ package highlight import ( "github.com/gofiber/fiber/v2" - "github.com/svera/coreander/v3/internal/webserver/jwtclaimsreader" + "github.com/svera/coreander/v3/internal/webserver/model" ) func (h *Controller) Remove(c *fiber.Ctx) error { - session := jwtclaimsreader.SessionData(c) - - user, err := h.usrRepository.FindByUuid(session.Uuid) - if err != nil { - return fiber.ErrBadRequest - } + user := c.Locals("Session").(model.User) document, err := h.idx.Document(c.FormValue("slug")) if err != nil { diff --git a/internal/webserver/embedded/views/document.html b/internal/webserver/embedded/views/document.html index 2c62ea3..c8b82ef 100644 --- a/internal/webserver/embedded/views/document.html +++ b/internal/webserver/embedded/views/document.html @@ -41,13 +41,14 @@