mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
restrict characters allowed in login
This commit is contained in:
parent
520fc2cfc5
commit
ea2fdec293
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user