mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-24 16:02:20 +08:00
Merge branch 'main' into next
This commit is contained in:
@@ -19,7 +19,6 @@ describe('base-auth', () => {
|
||||
|
||||
expect(auth.validateUsername('')).toBe(false);
|
||||
expect(auth.validateUsername('a@')).toBe(false);
|
||||
expect(auth.validateUsername('a.')).toBe(false);
|
||||
expect(auth.validateUsername('a<')).toBe(false);
|
||||
expect(auth.validateUsername('a>')).toBe(false);
|
||||
expect(auth.validateUsername('a"')).toBe(false);
|
||||
|
||||
@@ -67,7 +67,7 @@ export class BaseAuth extends Auth {
|
||||
* @internal
|
||||
*/
|
||||
validateUsername(username: string) {
|
||||
return /^[^@.<>"'/]{1,50}$/.test(username);
|
||||
return /^[^@<>"'/]{1,50}$/.test(username);
|
||||
}
|
||||
|
||||
async checkToken(): Promise<{
|
||||
|
||||
@@ -32,7 +32,7 @@ const isValidateEmpty = (value: any) => {
|
||||
|
||||
registerValidateRules({
|
||||
username(value) {
|
||||
return /^[^@.<>"'/]{1,50}$/.test(value) || i18n.t('Must be 1-50 characters in length (excluding @.<>"\'/)');
|
||||
return /^[^@<>"'/]{1,50}$/.test(value) || i18n.t('Must be 1-50 characters in length (excluding @<>"\'/)');
|
||||
},
|
||||
required(value, rule) {
|
||||
if (rule.required === false) return '';
|
||||
|
||||
@@ -56,7 +56,7 @@ const getPasswordForm = ({ showForgotPassword }: { showForgotPassword?: boolean
|
||||
return t("Please enter a valid email");
|
||||
}
|
||||
} else {
|
||||
return /^[^@.<>"'/]{1,50}$/.test(value) || t("Please enter a valid username");
|
||||
return /^[^@<>"'/]{1,50}$/.test(value) || t("Please enter a valid username");
|
||||
}
|
||||
}}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
|
||||
Reference in New Issue
Block a user