Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow users to change their names #3071

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

wescopeland
Copy link
Member

This PR gives users the ability to request name changes.

How it works

A new form has been added to /settings:
Screenshot 2025-01-17 at 10 01 51 PM

When the user attempts to submit the form, they get a confirm with this warning:
Screenshot 2025-01-17 at 10 02 37 PM

If the user confirms, the request is submitted and lives in the user_usernames table:
Screenshot 2025-01-17 at 10 03 10 PM

Screenshot 2025-01-17 at 10 03 35 PM
(note the new approved_at column)

In the management app, a new tool has been added:
Screenshot 2025-01-17 at 10 03 55 PM

The (1) badge indicates there is a pending username change request.

As an admin or moderator, I can view the list of pending username change requests:
Screenshot 2025-01-17 at 10 04 25 PM

If I click approve, the user's display_name value will be changed, something will be recorded to their account's audit log, and an email will be fired off:
Screenshot 2025-01-17 at 10 05 08 PM

Screenshot 2025-01-17 at 10 05 26 PM

This is the happy path case.

Alternatively, after 30 days, the username change request will "expire". It will no longer appear in the list of active requests, and the user will be able to request a new username change.

Other notes:

  • After setting a display_name, users do have the ability to request reverting back to their original username (they can bypass this uniqueness check).
  • Muted users cannot change their display_name.
  • After a display_name change is approved, users are put on a 30 day cooldown before they can request another change.

@wescopeland wescopeland requested a review from a team January 18, 2025 03:09
app/Helpers/util/mail.php Outdated Show resolved Hide resolved
@luchaos
Copy link
Member

luchaos commented Jan 23, 2025

Random thought: does it auto-approve and/or allow direct edits for case changes? given that we act case-insensitive it should probably be possible to change case at will; Luchaos is the same as luchaos internally. Just bringing this up as we had case change requests in the past.
Please ignore if this particular case (no pun intended) has been addressed otherwise.
Wonderful work as usual, guys. It's a real treat following your conversations ❤️

@wescopeland
Copy link
Member Author

Good question! It currently doesn't auto-approve those cases. But I think it would make a lot of sense to hunt that down in a subsequent PR before this goes live.

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.

3 participants