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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user