chore: add additional sanitisation

This commit is contained in:
Paul Makles committed 2023-06-11 12:26:18 +01:00
1 parent 0578a05a05
commit c8d5128b0c
4 files changed
+14 -1

No files matched your search

@@ -177,6 +177,11 @@ impl User {
// Copy the username for validation
let username_lowercase = username.to_lowercase();
// Block homoglyphs
if decancer::cure(&username_lowercase).into_str() != username_lowercase {
return Err(Error::InvalidUsername);
}
// Ensure the username itself isn't blocked
const BLOCKED_USERNAMES: &[&str] = &["admin", "revolt"];