summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard/controller.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/dashboard/controller.go')
-rw-r--r--app/controllers/dashboard/controller.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/controllers/dashboard/controller.go b/app/controllers/dashboard/controller.go
index 04a7ed1..d279930 100644
--- a/app/controllers/dashboard/controller.go
+++ b/app/controllers/dashboard/controller.go
@@ -41,14 +41,12 @@ func (c *Controller) Show(w http.ResponseWriter, r *http.Request) {
}
func (c *Controller) Navigation(w http.ResponseWriter, r *http.Request) {
- currentUser := cfg.CurrentUser.From(r.Context())
-
w.WriteHeader(http.StatusOK)
w.Header().Add("Content-Type", "text/html")
dto := &NavigationDTO{
- CurrentUser: currentUser,
- IsLoggedIn: currentUser != nil,
+ CurrentUser: cfg.CurrentUser.From(r.Context()),
+ IsLoggedIn: middleware.IsLoggedIn(r),
}
if err := views.Render(w, "dashboard/nav", dto); err != nil {
pls.LogError(r.Context(), err)