Skip to content

feat(profile): add display name input wired to PATCH /auth/me#37

Merged
amrtgaber merged 1 commit into
mainfrom
feat/profile-display-name
May 25, 2026
Merged

feat(profile): add display name input wired to PATCH /auth/me#37
amrtgaber merged 1 commit into
mainfrom
feat/profile-display-name

Conversation

@amrtgaber
Copy link
Copy Markdown
Contributor

Summary

  • Adds a labeled display-name input on /profile, pre-filled from auth.displayName.
  • Submit trims the value and PATCHes /auth/me; empty input clears the name (matches backend normalisation).
  • After save, re-syncs auth state via checkAuth() so the navbar updates without a reload. Success/error toasts.

Closes #35. Frontend-only — the backend already supports display_name on PATCH /auth/me, the profile UI just didn't expose it.

Test plan

  • Email/password user with no display name: open /profile, set a name, save → toast, navbar updates.
  • Edit existing name, save → updated value persists.
  • Clear the field → button label switches to "Clear display name", submitting toasts "Display name cleared." and the name disappears from navbar.
  • Type only whitespace into a previously empty field → Save stays disabled.
  • Backend returns 422 (e.g. paste 101+ chars before maxLength caps you, or have backend reject) → error toast surfaces the message.
  • Steam OAuth user (display_name populated from Steam) sees their name pre-filled and can change it.

Closes #35. Email/password users had no way to set a display name —
this exposes the existing backend field via a labeled input on the
profile page. Submit trims the value and PATCHes /auth/me, then
re-syncs auth state from /auth/me so the navbar updates without a
reload. Empty input clears the name (matches backend normalisation).
@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for criticalbit-auth-web ready!

Name Link
🔨 Latest commit 2e9ced7
🔍 Latest deploy log https://app.netlify.com/projects/criticalbit-auth-web/deploys/6a13d51d0a9286000830988e
😎 Deploy Preview https://deploy-preview-37--criticalbit-auth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@amrtgaber amrtgaber merged commit 0d0cbab into main May 25, 2026
6 checks passed
@amrtgaber amrtgaber deleted the feat/profile-display-name branch May 25, 2026 05:00
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.

Allow users to set their display name on the profile page

1 participant