mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
ignore unsage regex lint
This commit is contained in:
parent
e83c06a419
commit
c78691c87c
@ -24,6 +24,7 @@ const reservedAlias = [
|
||||
export const validateAlias = async (alias: string): Promise<void> => {
|
||||
if (alias.length < 3) throw new LogError('Given alias is too short', alias)
|
||||
if (alias.length > 20) throw new LogError('Given alias is too long', alias)
|
||||
/* eslint-disable-next-line security/detect-unsafe-regex */
|
||||
if (!alias.match(/^[0-9A-Za-z]([_-]?[A-Za-z0-9])+$/))
|
||||
throw new LogError('Invalid characters in alias', alias)
|
||||
if (reservedAlias.includes(alias.toLowerCase())) throw new LogError('Alias is not allowed', alias)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user