fix: don't allow user display name to be over 32 chars
This commit is contained in:
parent
946f78a90b
commit
fb2a9285d2
4 changed files with 145 additions and 139 deletions
|
@ -100,6 +100,11 @@ pub async fn update_user_settings_request(
|
|||
return Json(Error::NotAllowed.into());
|
||||
}
|
||||
|
||||
// check lengths
|
||||
if req.display_name.len() > 32 {
|
||||
return Json(Error::DataTooLong("display name".to_string()).into());
|
||||
}
|
||||
|
||||
// check percentage themes
|
||||
if !req.theme_sat.is_empty() && !req.theme_sat.ends_with("%") {
|
||||
req.theme_sat = format!("{}%", req.theme_sat)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue