diff options
Diffstat (limited to 'pkg/webui/login.go')
-rw-r--r-- | pkg/webui/login.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/webui/login.go b/pkg/webui/login.go index 6f688c1..18864b2 100644 --- a/pkg/webui/login.go +++ b/pkg/webui/login.go @@ -2,8 +2,10 @@ package webui import ( "context" + "encoding/json" "fmt" "html/template" + "log/slog" "net/http" "regexp" @@ -113,6 +115,11 @@ func loginMiddleware(db *database.DB, requireSession func(http.Handler) http.Han return } ctx := context.WithValue(r.Context(), model.AccountContextKey{}, account) + var settings model.Settings + if err := json.Unmarshal(account.Settings, &settings); err != nil { + slog.Error("failed to unmarshal account settings", "err", err, "accountId", account.Id) + } + ctx = context.WithValue(ctx, model.SettingsContextKey{}, &settings) next.ServeHTTP(w, r.WithContext(ctx)) })) } |