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

Prevent accidental user overwrites #139

Merged
merged 4 commits into from
Nov 12, 2024
Merged

Conversation

beastafk
Copy link
Contributor

@beastafk beastafk commented Nov 11, 2024

Synapse Admin API provides Create or modify API endpoint that allows overwriting existing users by default.

Sometimes, you may want such functionality, but there is a huge change that in the vast majority of cases that will lead to accidental/unexpected overwrites.

Luckily, a new endpoint was added to the Synapse Admin API, that can be used to prevent unexpected users overwrite: https://element-hq.github.io/synapse/latest/admin_api/user_admin_api.html#check-username-availability

Please make Synapse Admin to call that endpoint before creating a new user, and if there is already existing user with this username, show a modal window with "Warning! This username is already taken. Are you certain that you intend to overwrite the existing user?" alert and options to continue (i.e., send the request), and cancel.

It would be amazing if that check could be added to the new user form near the Username field as well, so when you're entering the username, you will see something like "✔️ username is available" and "⚠️ username is already taken" messages near the input field

image

@aine-etke
Copy link
Member

@aine-etke aine-etke merged commit b94b782 into main Nov 12, 2024
1 check passed
@aine-etke aine-etke deleted the prevent-accidental-overwrites branch November 12, 2024 08:15
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.

2 participants