@@ -726,7 +726,7 @@ private function checkTokenCredentials(IToken $dbToken, $token, array &$reason)
726726 if (!is_null ($ this ->activeUser ) && !$ this ->activeUser ->isEnabled ()) {
727727 $ reason = [
728728 'exception ' => $ ex ,
729- 'message ' => 'Paswordless token exception with no active or disabled user ' ,
729+ 'additional_message ' => 'Passwordless token exception with no active or disabled user ' ,
730730 ];
731731 $ this ->tokenProvider ->invalidateToken ($ token );
732732 return false ;
@@ -739,7 +739,7 @@ private function checkTokenCredentials(IToken $dbToken, $token, array &$reason)
739739 if (!is_null ($ this ->activeUser ) && !$ this ->activeUser ->isEnabled ()) {
740740 $ this ->tokenProvider ->invalidateToken ($ token );
741741 $ reason = [
742- 'message ' => 'Invalidate token as the user is no longer active ' ,
742+ 'additional_message ' => 'Invalidate token as the user is no longer active ' ,
743743 ];
744744 return false ;
745745 }
@@ -748,7 +748,7 @@ private function checkTokenCredentials(IToken $dbToken, $token, array &$reason)
748748 if ($ this ->manager ->checkPassword ($ dbToken ->getLoginName (), $ pwd ) === false ) {
749749 $ this ->tokenProvider ->markPasswordInvalid ($ dbToken , $ token );
750750 $ reason = [
751- 'message ' => 'The token password is no longer valid ' ,
751+ 'additional_message ' => 'The token password is no longer valid and is ' . ( empty ( $ pwd ) ? ' empty ' : ' not empty ' ) ,
752752 ];
753753 // User is logged out
754754 return false ;
@@ -787,10 +787,12 @@ private function validateToken(string $token, ?string $user = null): bool {
787787
788788 $ reason = [];
789789 if (!$ this ->checkTokenCredentials ($ dbToken , $ token , $ reason )) {
790- $ this ->logger ->warning ('Session token credentials are invalid ' , array_merge ( $ reason , [
790+ $ this ->logger ->warning ('Session token credentials are invalid ' , [
791791 'app ' => 'core ' ,
792792 'user ' => $ user ,
793- ]));
793+ 'token name ' => $ dbToken ->getName (),
794+ ...$ reason ,
795+ ]);
794796 return false ;
795797 }
796798
0 commit comments