Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-22 05:10:29 +01:00
fixes for current upstream main
Dieser Commit ist enthalten in:
Ursprung
c6c45c4c49
Commit
adaefc8628
2 geänderte Dateien mit 1 neuen und 22 gelöschten Zeilen
|
@ -2583,7 +2583,7 @@ async fn put_reset_password(
|
||||||
|
|
||||||
let reset_request = data.into_inner().data;
|
let reset_request = data.into_inner().data;
|
||||||
|
|
||||||
user.set_password_and_key(reset_request.NewMasterPasswordHash.as_str(), reset_request.Key.as_str(), None);
|
user.set_password(reset_request.NewMasterPasswordHash.as_str(), Some(reset_request.Key), true, None);
|
||||||
user.save(&mut conn).await?;
|
user.save(&mut conn).await?;
|
||||||
|
|
||||||
nt.send_user_update(UpdateType::LogOut, &user).await;
|
nt.send_user_update(UpdateType::LogOut, &user).await;
|
||||||
|
|
|
@ -178,27 +178,6 @@ impl User {
|
||||||
self.security_stamp = crate::util::get_uuid();
|
self.security_stamp = crate::util::get_uuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the password hash generated
|
|
||||||
/// And resets the security_stamp. Based upon the allow_next_route the security_stamp will be different.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
///
|
|
||||||
/// * `new_password_hash` - A str which contains a hashed version of the users master password.
|
|
||||||
/// * `new_key` - A String which contains the new aKey value of the users master password.
|
|
||||||
/// * `allow_next_route` - A Option<Vec<String>> with the function names of the next allowed (rocket) routes.
|
|
||||||
/// These routes are able to use the previous stamp id for the next 2 minutes.
|
|
||||||
/// After these 2 minutes this stamp will expire.
|
|
||||||
///
|
|
||||||
pub fn set_password_and_key(
|
|
||||||
&mut self,
|
|
||||||
new_password_hash: &str,
|
|
||||||
new_key: &str,
|
|
||||||
allow_next_route: Option<Vec<String>>,
|
|
||||||
) {
|
|
||||||
self.set_password(new_password_hash, allow_next_route);
|
|
||||||
self.akey = String::from(new_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Set the stamp_exception to only allow a subsequent request matching a specific route using the current security-stamp.
|
/// Set the stamp_exception to only allow a subsequent request matching a specific route using the current security-stamp.
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
|
|
Laden …
In neuem Issue referenzieren