From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Thu, 29 Jul 2021 05:51:11 +0000 (+0530) Subject: Merge branch 'master' into phildenhoff/fix-at-sigil-in-localpart X-Git-Tag: v1.1.0~51^2 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=4d3d6ea9a7736dab4dd6b9ccb47b09b7b372c38d;p=rainny.git Merge branch 'master' into phildenhoff/fix-at-sigil-in-localpart --- 4d3d6ea9a7736dab4dd6b9ccb47b09b7b372c38d diff --cc src/app/templates/auth/Auth.jsx index a16206d,cd287e2..d66617b --- a/src/app/templates/auth/Auth.jsx +++ b/src/app/templates/auth/Auth.jsx @@@ -13,12 -13,8 +13,12 @@@ import Spinner from '../../atoms/spinne import CinnySvg from '../../../../public/res/svg/cinny.svg'; -const USERNAME_REGEX = /^[a-z0-9_\-.=/]+$/; -const BAD_USERNAME_ERROR = 'Username must contain only lowercase letters, numbers, dashes and underscores.'; +// This regex validates historical usernames, which don't satisy today's username requirements. +// See https://matrix.org/docs/spec/appendices#id13 for more info. +const LOCALPART_LOGIN_REGEX = /^[!-9|;-~]+$/; - const LOCALPART_SIGNUP_REGEX = /^[a-z0-9_\-+./]+$/; - const BAD_LOCALPART_ERROR = 'Username must contain only lowercase letters, numbers, dashes and underscores.'; ++const LOCALPART_SIGNUP_REGEX = /^[a-z0-9_\-.=/]+$/; ++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 PASSWORD_REGEX = /.+/; const PASSWORD_STRENGHT_REGEX = /^(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[^\w\d\s:])([^\s]){8,16}$/;