Skip to content

Add account menu, self-service profile/password, and org selector fixes - #142

Merged
shrsv merged 1 commit into
masterfrom
ui-refine
Oct 27, 2026
Merged

shrsv merged 1 commit into
masterfrom
ui-refine

Conversation

@shrsv

@shrsv shrsv commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the bare logout icon in the navbar with an account menu: a deterministic avatar (stable initials + color, hashed from the user's id/email so it never changes across sessions) that opens a popover with "Profile and preferences", "Change password", "API keys", and "Sign out".
  • Adds a self-service Account tab at /settings#account (visible to every authenticated user, no org-role gate) for editing your own name and changing your password, backed by the existing PUT /users/profile and PUT /users/password endpoints.
  • Hardens those two endpoints, since this PR is their first real caller: they're now session-only (API keys are rejected, per the "sensitive account actions require a JWT session" rule) and their DB write + audit event now commit atomically in one transaction (previously unaudited and reachable via API key despite being credential changes).
  • Fixes the organization selector: the current org is now pinned in its own "Current organization" section at the top of the switcher (previously highlighted wherever it happened to fall in the list), and role labels render properly ("Super Admin" instead of CSS-capitalized "Super_admin") — fixed consistently everywhere an org role string is rendered (org selector + 3 User Management views).
  • Adds a "My Account" group to the Settings mega menu, and a routes_guide doc for the new tab.

Checks run locally (mirroring CI)

  • make testall — all Go tests pass
  • npx tsc --noEmit — clean
  • gofmt -l on changed files — clean
  • go vet on touched packages — clean (one pre-existing unreachable-code warning in internal/api/middleware/selfhosted_enforcement.go, unrelated to this change)
  • make security-govulncheck — no vulnerabilities
  • make security-osv — 0 results
  • make security-gitleaks — no leaks found (2384 commits scanned)
  • make security-semgrep — 0 findings (1817 rules / 2311 files)

Test plan

  • Open the navbar account menu, confirm the avatar shows stable initials/color across reloads.
  • Update your name on /settings#account, confirm it reflects immediately in the navbar avatar/name.
  • Change your password via the same tab, confirm the old password fails and the new one works.
  • Confirm PUT /users/profile / PUT /users/password are rejected (403) when called with an API key instead of a session.
  • Open the organization switcher with multiple orgs, confirm the current org is pinned at the top and role labels read "Super Admin" / "Owner" / "Member".

🔍 LiveReview

⚙️ Customize risk-based approval policy for this repository or your organization.

…selector fixes

Replaces the bare logout icon in the navbar with an account menu (deterministic
avatar with stable initials/color, profile/password/API-key links, sign out).
Adds a self-service Account settings tab backed by the existing /users/profile
and /users/password endpoints, which are now session-only and commit their
audit event atomically with the write (previously unaudited and reachable via
API key, despite being credential changes).

Also fixes the organization selector to pin the current org at the top of the
switcher (instead of wherever it falls in the list) and to render role labels
properly ("Super Admin" instead of "Super_admin"), applied consistently
wherever org roles are rendered.

LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
@shrsv
shrsv merged commit d0c2dd8 into master Oct 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant