refactor(store): single account name on users; rename profile/laps tables
users.display_name becomes users.name and is now the only human-facing name -- profiles.name is dropped (it duplicated the account name; the Profile page's Name field now edits users.name through PUT /api/profile, which carries Name alongside the profiles columns). The profile table becomes profiles and laps becomes activity_laps, homogeneous with activity_samples. Onboarding pre-fills the display name from the OIDC claim's name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,8 +14,8 @@ const resolvedUserContextKey userContextKey = iota
|
||||
// resolvedUser is the geniusrun account (if any) bound to the current
|
||||
// session's OIDC subject.
|
||||
type resolvedUser struct {
|
||||
ID int64
|
||||
DisplayName string
|
||||
ID int64
|
||||
Name string
|
||||
}
|
||||
|
||||
// resolveUser runs after auth.RequireSession on every request and looks up
|
||||
@@ -40,7 +40,7 @@ func (s *Server) resolveUser(next http.Handler) http.Handler {
|
||||
}
|
||||
ctx := r.Context()
|
||||
if found {
|
||||
ctx = context.WithValue(ctx, resolvedUserContextKey, resolvedUser{ID: u.ID, DisplayName: u.DisplayName})
|
||||
ctx = context.WithValue(ctx, resolvedUserContextKey, resolvedUser{ID: u.ID, Name: u.Name})
|
||||
}
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user