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:
parent
f573221643
commit
cfe12956da
1 changed files with 2 additions and 1 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue