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

View File

@ -36,7 +36,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$
&& wget -P /app https://go.dev/dl/go1.17.5.linux-${ARCHITECTURE}.tar.gz \ && wget -P /app https://go.dev/dl/go1.17.5.linux-${ARCHITECTURE}.tar.gz \
&& tar -C /usr/local -xzf /app/go1.17.5.linux-${ARCHITECTURE}.tar.gz && tar -C /usr/local -xzf /app/go1.17.5.linux-${ARCHITECTURE}.tar.gz
RUN git clone https://github.com/balzack/databag.git /app/databag RUN git clone https://github.com/balzack/databag.git /app/databag
RUN yarn config set network-timeout 300000 RUN yarn config set network-timeout 300000
RUN yarn --cwd /app/databag/net/web install RUN yarn --cwd /app/databag/net/web install