diff --git a/handlers/handler.go b/handlers/handler.go index 42d729f..6d13c35 100644 --- a/handlers/handler.go +++ b/handlers/handler.go @@ -39,7 +39,6 @@ func (a *Handler) OptionalAuthPage(h http.HandlerFunc) http.HandlerFunc { return } ctx := context.WithValue(r.Context(), ProfileIdKey, profile.Id) - ctx = context.WithValue(ctx, FullNameKey, profile.Name) h(w, r.WithContext(ctx)) }) } @@ -51,7 +50,6 @@ func (a *Handler) AuthPage(h http.HandlerFunc) http.HandlerFunc { profile, err := a.authenticate(r) authed := err == nil ctx := context.WithValue(r.Context(), ProfileIdKey, profile.Id) - ctx = context.WithValue(ctx, FullNameKey, profile.Name) switch { case authed && slices.Contains(noAuthPaths, r.URL.Path): @@ -87,7 +85,6 @@ func (a *Handler) OptionalAuthApi(h http.HandlerFunc) http.HandlerFunc { return } ctx := context.WithValue(r.Context(), ProfileIdKey, profile.Id) - ctx = context.WithValue(ctx, FullNameKey, profile.Name) h(w, r.WithContext(ctx)) } } @@ -132,7 +129,7 @@ func (a *Handler) authenticate(r *http.Request) (entities.Profile, error) { profileRepo. GetDB(). Model(&profile). - Select("id", "name"). + Select("id"). Where("username = ?", username). First(&profile). Error diff --git a/handlers/keys.go b/handlers/keys.go index 6eae5e5..affff75 100644 --- a/handlers/keys.go +++ b/handlers/keys.go @@ -12,6 +12,5 @@ const ( ProfileIdKey = "profile-id" ThemeKey = "theme-name" IsMobileKey = "is-mobile" - FullNameKey = "full-name" PlaylistPermission = "playlist-permission" ) diff --git a/views/components/header/header.templ b/views/components/header/header.templ index 319f3d7..2367e8a 100644 --- a/views/components/header/header.templ +++ b/views/components/header/header.templ @@ -21,36 +21,28 @@ templ homeLinkContainer() { } templ mobileHeader() { -
+
@navlink.LinkContainer("/about", "About", icons.About()) - @themeswitch.ThemeSwitch() -
-
-
+
DankMuzikk Logo

DankMuzikk

-
-

- if fullName, ok := ctx.Value("full-name").(string); ok { - Hi { fullName } 👋 - } else { - Hiyo 👋 - } -
- Wanna play something? -

-
-
- @search.Search() -
+ @themeswitch.ThemeSwitch() +
+
+ @search.Search()
} diff --git a/views/components/popover/popover.templ b/views/components/popover/popover.templ index 073a0c3..18968dc 100644 --- a/views/components/popover/popover.templ +++ b/views/components/popover/popover.templ @@ -20,7 +20,7 @@ templ Popover(id, title string, button, child templ.Component) {
diff --git a/views/components/search/search.templ b/views/components/search/search.templ index c9b9a9d..37607e4 100644 --- a/views/components/search/search.templ +++ b/views/components/search/search.templ @@ -42,7 +42,7 @@ templ Search() {