add: user stacks
This commit is contained in:
parent
8c3024cb40
commit
75d72460ae
28 changed files with 1028 additions and 9 deletions
|
@ -127,6 +127,16 @@ impl DataManager {
|
|||
return Err(Error::MiscError("This username cannot be used".to_string()));
|
||||
}
|
||||
|
||||
if data.username.contains(" ") {
|
||||
return Err(Error::MiscError("Name cannot contain spaces".to_string()));
|
||||
} else if data.username.contains("%") {
|
||||
return Err(Error::MiscError("Name cannot contain \"%\"".to_string()));
|
||||
} else if data.username.contains("?") {
|
||||
return Err(Error::MiscError("Name cannot contain \"?\"".to_string()));
|
||||
} else if data.username.contains("&") {
|
||||
return Err(Error::MiscError("Name cannot contain \"&\"".to_string()));
|
||||
}
|
||||
|
||||
// make sure username isn't taken
|
||||
if self.get_user_by_username(&data.username).await.is_ok() {
|
||||
return Err(Error::UsernameInUse);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue