restrict characters allowed in login

This commit is contained in:
balzack 2023-05-06 23:39:22 -07:00
parent 520fc2cfc5
commit ea2fdec293
2 changed files with 8 additions and 1 deletions

View File

@ -72,6 +72,13 @@ export function useCreate() {
if (debounce.current) {
clearTimeout(debounce.current);
}
const restricted = new RegExp('[!@#$%^&*()\ ,.?":{}|<>]', 'i');
if (restricted.test(state.username)) {
updateState({ usernameValid: false });
return;
}
debounce.current = setTimeout(async () => {
checking.current = true;
debounce.current = null;