Added '@' as a illegal character for usernames

ref #93
This commit is contained in:
2021-01-13 17:51:42 +01:00
parent 9feeb302e8
commit 37fc167002
4 changed files with 23 additions and 6 deletions

View File

@@ -14,6 +14,18 @@ export class UsernameOrEmailNeededError extends NotFoundError {
message = "No username or email is set!"
}
/**
* Error to throw when no username contains illegal characters.
* Right now the only one is "@" but this could change in the future.
*/
export class UsernameContainsIllegalCharacterError extends NotAcceptableError {
@IsString()
name = "UsernameContainsIllegalCharacterError"
@IsString()
message = "The provided username contains illegal characters! \n Right now the following characters are considered illegal: '@'"
}
/**
* Error to throw when no email is set.
* We somehow need to identify you :)