File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ async fn verify_password_if_needed(
8484 password,
8585 user_password. hashed_password ,
8686 )
87- . await ;
87+ . await ? ;
8888
89- Ok ( res. is_ok ( ) )
89+ Ok ( res. is_success ( ) )
9090}
Original file line number Diff line number Diff line change @@ -737,13 +737,14 @@ impl UserMutations {
737737 ) ) ;
738738 } ;
739739
740- if let Err ( _err ) = password_manager
740+ if ! password_manager
741741 . verify (
742742 active_password. version ,
743743 Zeroizing :: new ( current_password_attempt) ,
744744 active_password. hashed_password ,
745745 )
746- . await
746+ . await ?
747+ . is_success ( )
747748 {
748749 return Ok ( SetPasswordPayload {
749750 status : SetPasswordStatus :: WrongPassword ,
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ impl<T> PasswordVerificationResult<T> {
4949 Self :: Failure => PasswordVerificationResult :: Failure ,
5050 }
5151 }
52+
53+ #[ must_use]
54+ pub fn is_success ( & self ) -> bool {
55+ matches ! ( self , Self :: Success ( _) )
56+ }
5257}
5358
5459impl From < bool > for PasswordVerificationResult < ( ) > {
You can’t perform that action at this time.
0 commit comments