mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
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:
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user