@@ -230,23 +230,23 @@ impl ProfileService {
230
230
/// * An error if unable to successfully hash the password.
231
231
/// * An error if unable to change the password in the database.
232
232
/// * An error if it is not possible to authorize the action
233
+ #[ allow( clippy:: missing_panics_doc) ]
233
234
pub async fn change_password (
234
235
& self ,
235
- user_id : UserId ,
236
- change_password_form : & ChangePasswordForm ,
237
236
maybe_user_id : Option < UserId > ,
237
+ change_password_form : & ChangePasswordForm ,
238
238
) -> Result < ( ) , ServiceError > {
239
239
self . authorization_service
240
240
. authorize ( ACTION :: ChangePassword , maybe_user_id)
241
241
. await ?;
242
242
243
- info ! ( "changing user password for user ID: {user_id}" ) ;
243
+ info ! ( "changing user password for user ID: {}" , maybe_user_id . unwrap ( ) ) ;
244
244
245
245
let settings = self . configuration . settings . read ( ) . await ;
246
246
247
247
let user_authentication = self
248
248
. user_authentication_repository
249
- . get_user_authentication_from_id ( & user_id )
249
+ . get_user_authentication_from_id ( & maybe_user_id . unwrap ( ) )
250
250
. await ?;
251
251
252
252
verify_password ( change_password_form. current_password . as_bytes ( ) , & user_authentication) ?;
@@ -265,7 +265,7 @@ impl ProfileService {
265
265
let password_hash = hash_password ( & change_password_form. password ) ?;
266
266
267
267
self . user_authentication_repository
268
- . change_password ( user_id , & password_hash)
268
+ . change_password ( maybe_user_id . unwrap ( ) , & password_hash)
269
269
. await ?;
270
270
271
271
Ok ( ( ) )
0 commit comments