fix(client,server): usernames should not be a http error code (#37804)

* fix(client,server): usernames should not be a http error code
* feat: reject invalid chars first

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
mrugesh
2019-11-27 10:49:17 +05:30
committed by GitHub
parent b7949087e3
commit 9886cf7ca2
4 changed files with 53 additions and 29 deletions

View File

@@ -17,7 +17,7 @@ import {
} from '../../redux/settings';
import BlockSaveButton from '../helpers/form/BlockSaveButton';
import FullWidthRow from '../helpers/FullWidthRow';
import { validate } from '../../../../utils/validate';
import { isValidUsername } from '../../../../utils/validate';
const propTypes = {
isValidUsername: PropTypes.bool,
@@ -112,7 +112,7 @@ class UsernameSettings extends Component {
}
validateFormInput(formValue) {
return validate(formValue);
return isValidUsername(formValue);
}
renderAlerts(validating, error, isValidUsername) {