Skip to content

feat: add option to change username #5199

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

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

Conversation

Fijxu
Copy link
Member

@Fijxu Fijxu commented Mar 6, 2025

Tested and it works fine. I made this for people that want to change their username on public Invidious instances without having to create a new account or having to contact the instance maintainer to change their username. It also updates the materialized views sha256 ids, so if a user changed their account name from user to user2 and a new user registers on the instance with the username user, there shouldn't be a relation collision (when the collision happens, this is displayed: relation "subscriptions_sha256" already exists)

Tested:

  • Changing username from user1 to user2, subscriptions are maintained across username changes
  • Playlist author (for Invidious playlists) updated on username change.
  • Changing the username from user2 back to user1 works well.
  • If the user tries to change their username to one that already exists on the database, a "Username is already taken, use another one" will be returned. (Although someone can still register or change their username with an already taken username but with a slight unnoticeable SPACE character on it, it's possible to have a user called user1 and user1 )

@Fijxu Fijxu requested review from SamantazFox and a team as code owners March 6, 2025 22:35
@Fijxu
Copy link
Member Author

Fijxu commented Mar 6, 2025

Note: This conflicts with #2469 due to the use of materialized views.

Users that changed their username to something like `User`, were unable
to login because the username is downcased on routes/login.cr
@Fijxu Fijxu requested a review from syeopite March 27, 2025 01:42
"accounts_username_required_field": "Username is a required field",
"accounts_username_empty": "Username cannot be empty",
"accounts_username_is_the_same": "This is your username, use another one",
"accounts_username_taken": "Username is already taken, use another one"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd need to use UUIDs of some sort to differenciate accounts at some point. I'm worried that account name switching could be used to find if someone else is registered on this instance.

Copy link
Member Author

@Fijxu Fijxu Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried that account name switching could be used to find if someone else is registered on this instance.

That is already possible in the login page, if you insert a registered user with a wrong password it will return Wrong username or password.

Unless you are referring to another case I'm missing

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