diff --git a/internal/webserver/controller/auth/signin.go b/internal/webserver/controller/auth/signin.go index 6d4a620..9be3d3d 100644 --- a/internal/webserver/controller/auth/signin.go +++ b/internal/webserver/controller/auth/signin.go @@ -41,7 +41,7 @@ func (a *Controller) SignIn(c *fiber.Ctx) error { Name: "coreander", Value: signedToken, Path: "/", - MaxAge: int(a.config.SessionTimeout.Seconds()), + MaxAge: 34560000, // 400 days which is the life limit imposed by Chrome Secure: false, HTTPOnly: true, }) diff --git a/internal/webserver/controller/auth/signout.go b/internal/webserver/controller/auth/signout.go index acdf654..7daec00 100644 --- a/internal/webserver/controller/auth/signout.go +++ b/internal/webserver/controller/auth/signout.go @@ -8,7 +8,7 @@ import ( func (a *Controller) SignOut(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: "coreander", - Value: "void", + Value: "", Path: "/", MaxAge: -1, Secure: false, diff --git a/internal/webserver/controller/highlight/list.go b/internal/webserver/controller/highlight/list.go index 10fcd73..d3a8d16 100644 --- a/internal/webserver/controller/highlight/list.go +++ b/internal/webserver/controller/highlight/list.go @@ -32,7 +32,7 @@ func (h *Controller) List(c *fiber.Ctx) error { h.wordsPerMinute = session.WordsPerMinute } - user, err := h.usrRepository.FindByUsername(c.Params("username")) + user, err := h.usrRepository.FindByUsername(session.Username) if err != nil { log.Println(err.Error()) return fiber.ErrInternalServerError diff --git a/internal/webserver/embedded/views/document.html b/internal/webserver/embedded/views/document.html index 1ce56b8..2f17f35 100644 --- a/internal/webserver/embedded/views/document.html +++ b/internal/webserver/embedded/views/document.html @@ -41,14 +41,14 @@