Browse Source

fix: allow only alphanumeric chars in username

pull/3437/head
varungujarathi9 2 years ago
parent
commit
1d37b21383
  1. 5
      web/pages/admin/config-federation.tsx

5
web/pages/admin/config-federation.tsx

@ -126,9 +126,7 @@ const ConfigFederation = () => { @@ -126,9 +126,7 @@ const ConfigFederation = () => {
const usernameValue = value;
const hasUsername = usernameValue !== '';
if (hasUsername) {
if (usernameValue.includes('@')) {
const usernameWithoutServer = usernameValue.split('@').slice(0, -1).join('@');
if (usernameWithoutServer.length > 0 && isAlphanumeric(usernameWithoutServer)) {
if (isAlphanumeric(usernameValue)) {
setIsUsernameValid(true);
} else {
setIsUsernameValid(false);
@ -136,7 +134,6 @@ const ConfigFederation = () => { @@ -136,7 +134,6 @@ const ConfigFederation = () => {
} else {
setIsUsernameValid(false);
}
}
};
const handleEnabledSwitchChange = (value: boolean) => {

Loading…
Cancel
Save