feat: increase password max to 256, fix i18n, and force re-login #83

- Raise password maximum length from 32 to 256 characters
- fix profileSchema to accept `t` for proper internationalization
- Invalidate user's WebUI token on password change, requiring re-login
This commit is contained in:
rustmailer
2025-12-30 11:05:07 +08:00
parent c01872284e
commit 62d956c7d6
23 changed files with 66 additions and 54 deletions
+6
View File
@@ -444,6 +444,7 @@ impl BichonUser {
pub async fn update(id: u64, request: UserUpdateRequest) -> BichonResult<()> {
let _ = &request.validate().await?;
let password_changed = request.password.is_some();
if DEFAULT_ADMIN_USER_ID == id && request.global_roles.is_some() {
return Err(raise_error!(
@@ -537,6 +538,11 @@ impl BichonUser {
},
)
.await?;
if password_changed {
AccessTokenModel::reset_webui_token(id).await?;
}
Ok(())
}