@@ -227,6 +227,7 @@ public function authenticate($username, $password)
227227
228228 $ response = $ this ->client ->adminInitiateAuth ($ payload );
229229 } catch (CognitoIdentityProviderException $ exception ) {
230+ Log::error ('CognitoIdentityProvider:adminInitiateAuth:Exception ' );
230231 throw $ exception ;
231232 } //Try-catch ends
232233
@@ -385,6 +386,7 @@ public function adminListGroupsForUser(string $username)
385386 );
386387 return $ groups ;
387388 } catch (CognitoIdentityProviderException $ e ) {
389+ Log::error ('CognitoIdentityProvider:adminListGroupsForUser:Exception ' );
388390 throw $ e ;
389391 } //Try-catch ends
390392
@@ -410,6 +412,7 @@ public function adminAddUserToGroup(string $username, string $groupname)
410412 'Username ' => $ username
411413 ]);
412414 } catch (CognitoIdentityProviderException $ e ) {
415+ Log::error ('CognitoIdentityProvider:adminAddUserToGroup:Exception ' );
413416 throw $ e ;
414417 } //Try-catch ends
415418
@@ -435,7 +438,7 @@ public function inviteUser(string $username, string $password=null, array $attri
435438 //Validate phone for MFA
436439 if (config ('cognito.mfa_setup ' )=="MFA_ENABLED " ) {
437440 if (empty ($ attributes ['phone_number ' ])) { throw new HttpException (400 , 'ERROR_MFA_ENABLED_PHONE_MISSING ' ); }
438- } //End if
441+ } //End if
439442
440443 //Force validate email
441444 if ($ attributes ['email ' ]) {
@@ -636,7 +639,7 @@ public function confirmUserSignUp($username, $confirmationCode)
636639 return 'validation.invalid_token ' ;
637640 } //End if
638641
639- if ($ e ->getAwsErrorCode () === 'NotAuthorizedException ' AND $ e ->getAwsErrorMessage () === 'User cannot be confirmed. Current status is CONFIRMED ' ) {
642+ if ($ e ->getAwsErrorCode () === 'NotAuthorizedException ' && $ e ->getAwsErrorMessage () === 'User cannot be confirmed. Current status is CONFIRMED ' ) {
640643 return 'validation.confirmed ' ;
641644 } //End if
642645
@@ -698,6 +701,7 @@ public function setUserAttributes($username, array $attributes)
698701 //Execute the payload
699702 $ this ->client ->AdminUpdateUserAttributes ($ payload );
700703 } catch (CognitoIdentityProviderException $ e ) {
704+ Log::error ('CognitoIdentityProvider:adminUpdateUserAttributes:Exception ' );
701705 throw $ e ;
702706 } //End try
703707
@@ -713,7 +717,7 @@ public function setUserAttributes($username, array $attributes)
713717 * @param string $session
714718 * @param string $challengeValue
715719 * @param string $username
716- *
720+ *
717721 * @return \Aws\Result
718722 */
719723 protected function adminRespondToAuthChallenge (
@@ -766,6 +770,7 @@ protected function adminRespondToAuthChallenge(
766770 //Execute the payload
767771 $ response = $ this ->client ->adminRespondToAuthChallenge ($ payload );
768772 } catch (CognitoIdentityProviderException $ e ) {
773+ Log::error ('CognitoIdentityProvider:adminRespondToAuthChallenge:Exception ' );
769774 throw $ e ;
770775 } //Try-catch ends
771776
@@ -837,6 +842,7 @@ public function getUserByAccessToken(string $token)
837842 'AccessToken ' => $ token
838843 ]);
839844 } catch (CognitoIdentityProviderException $ e ) {
845+ Log::error ('CognitoIdentityProvider:getUserByAccessToken:Exception ' );
840846 throw $ e ;
841847 } //Try-catch ends
842848
@@ -916,6 +922,7 @@ public function refreshToken(string $username, string $refreshToken)
916922 // Reuse same refreshToken
917923 $ response ['AuthenticationResult ' ]['RefreshToken ' ] = $ refreshToken ;
918924 } catch (CognitoIdentityProviderException $ e ) {
925+ Log::error ('CognitoIdentityProvider:refreshToken:Exception ' );
919926 throw $ e ;
920927 } //Try-catch ends
921928
@@ -940,6 +947,7 @@ public function revokeToken(string $refreshToken)
940947 'Token ' => $ refreshToken
941948 ]);
942949 } catch (Exception $ e ) {
950+ Log::error ('CognitoIdentityProvider:revokeToken:Exception ' );
943951 throw $ e ;
944952 } //Try-catch ends
945953 return true ;
0 commit comments