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() { -
- if fullName, ok := ctx.Value("full-name").(string); ok {
- Hi { fullName } 👋
- } else {
- Hiyo 👋
- }
-
- Wanna play something?
-