pub async fn update_user_security(
pool: &Pool<MySql>,
id: i64,
password: Option<&str>,
salt: Option<&str>,
two_factor_enabled: Option<bool>,
two_factor_verified: Option<bool>,
) -> Result<User>
Expand description
Updates a user’s security settings.
This function updates security-related fields in the users table.
§Arguments
pool
- Database connection pool for executing the queryid
- Unique identifier of the userpassword
- Optional new password (should be pre-hashed)salt
- Optional new salt (should be provided if password is)two_factor_enabled
- Optional flag to enable/disable two-factor authenticationtwo_factor_verified
- Optional flag indicating 2FA verification status
§Returns
Ok(User)
- Successfully updated user security settingsErr(anyhow::Error)
- Failed to update user security settings