1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Remove trailing whitespace from new users' usernames (#6528)

* Add input validation and error toast when attempting to add a new user with whitespaces at beginning or end.

* Update from OR expression

* Remove changes to en-gb due to only allowing direct commits to en-us.

* Update to automatically trim instead of showing a message.
This commit is contained in:
Jxiced 2025-02-20 21:21:42 +00:00 committed by GitHub
parent f573221643
commit cfe12956da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,8 +111,9 @@ const UserNew = () => {
const saveUser = () => {
const userInput: UserInput = {};
userInput.Name = (page.querySelector('#txtUsername') as HTMLInputElement).value;
userInput.Name = (page.querySelector('#txtUsername') as HTMLInputElement).value.trim();
userInput.Password = (page.querySelector('#txtPassword') as HTMLInputElement).value;
window.ApiClient.createUser(userInput).then(function (user) {
if (!user.Id || !user.Policy) {
throw new Error('Unexpected null user id or policy');