removed username regex from login

This commit is contained in:
unknown 2021-08-12 16:18:01 +05:30
parent e730eb3a32
commit 4b5553abef

View file

@ -15,7 +15,7 @@ import CinnySvg from '../../../../public/res/svg/cinny.svg';
// This regex validates historical usernames, which don't satisy today's username requirements. // This regex validates historical usernames, which don't satisy today's username requirements.
// See https://matrix.org/docs/spec/appendices#id13 for more info. // See https://matrix.org/docs/spec/appendices#id13 for more info.
const LOCALPART_LOGIN_REGEX = /^[!-9|;-~]+$/; const LOCALPART_LOGIN_REGEX = /.*/;
const LOCALPART_SIGNUP_REGEX = /^[a-z0-9_\-.=/]+$/; const LOCALPART_SIGNUP_REGEX = /^[a-z0-9_\-.=/]+$/;
const BAD_LOCALPART_ERROR = 'Username must contain only a-z, 0-9, ., _, =, -, and /.'; const BAD_LOCALPART_ERROR = 'Username must contain only a-z, 0-9, ., _, =, -, and /.';
const USER_ID_TOO_LONG_ERROR = 'Your user ID, including the hostname, can\'t be more than 255 characters long.'; const USER_ID_TOO_LONG_ERROR = 'Your user ID, including the hostname, can\'t be more than 255 characters long.';
@ -120,11 +120,6 @@ function Auth({ type }) {
/** @type {string} */ /** @type {string} */
const normalizedUsername = normalizeUsername(rawUsername); const normalizedUsername = normalizeUsername(rawUsername);
if (!isValidInput(normalizedUsername, LOCALPART_LOGIN_REGEX)) {
showBadInputError(usernameRef.current, BAD_LOCALPART_ERROR);
return;
}
auth.login(normalizedUsername, homeserverRef.current.value, passwordRef.current.value) auth.login(normalizedUsername, homeserverRef.current.value, passwordRef.current.value)
.then(() => { .then(() => {
document.getElementById('auth_submit-btn').disabled = false; document.getElementById('auth_submit-btn').disabled = false;