From adaefc8628423dd7aebb39e76ce35ee00ce618c5 Mon Sep 17 00:00:00 2001 From: sirux88 Date: Wed, 25 Jan 2023 08:09:26 +0100 Subject: [PATCH] fixes for current upstream main --- src/api/core/organizations.rs | 2 +- src/db/models/user.rs | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 4b0605f8..964d4c4d 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -2583,7 +2583,7 @@ async fn put_reset_password( 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?; nt.send_user_update(UpdateType::LogOut, &user).await; diff --git a/src/db/models/user.rs b/src/db/models/user.rs index 2ca770b5..5ce87e14 100644 --- a/src/db/models/user.rs +++ b/src/db/models/user.rs @@ -178,27 +178,6 @@ impl User { 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> 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>, - ) { - 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. /// /// # Arguments