diff options
Diffstat (limited to 'MoodlePasswordPrimaryAuthenticationProvider.php')
-rw-r--r-- | MoodlePasswordPrimaryAuthenticationProvider.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/MoodlePasswordPrimaryAuthenticationProvider.php b/MoodlePasswordPrimaryAuthenticationProvider.php index 212c6bf..75c9bef 100644 --- a/MoodlePasswordPrimaryAuthenticationProvider.php +++ b/MoodlePasswordPrimaryAuthenticationProvider.php @@ -146,6 +146,10 @@ class MoodlePasswordPrimaryAuthenticationProvider extends AbstractPrimaryAuthent if ( !empty( $decoded->token ) ) { return $decoded->token; + } else if ( isset( $decoded->exception ) ) { + $this->logger->error( 'AuthMoodle: Remote exception: '.$decoded->exception ); + return false; + } else if ( isset( $decoded->error ) ) { $this->logger->error( 'AuthMoodle: Remote error: '.$decoded->error ); return false; @@ -256,6 +260,11 @@ class MoodlePasswordPrimaryAuthenticationProvider extends AbstractPrimaryAuthent return false; } + if ( isset( $decoded->exception ) ) { + $this->logger->error( 'AuthMoodle: Remote exception: '.$decoded->exception ); + return false; + } + return (object) [ 'fullname' => $decoded[0]->fullname, 'email' => $decoded[0]->email, |