From d1767522a94eba4255ef3a0ed30a901460373a65 Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Thu, 26 Sep 2024 11:06:40 +1000 Subject: [PATCH] Fix an error when logging error codes --- src/base/OAuthProviderTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/base/OAuthProviderTrait.php b/src/base/OAuthProviderTrait.php index 5becc15..267afea 100644 --- a/src/base/OAuthProviderTrait.php +++ b/src/base/OAuthProviderTrait.php @@ -170,7 +170,11 @@ public function getAccessToken(): OAuth1Token|OAuth2Token|null $error = $request->getParam('error_code'); if ($error) { - Auth::error('An error occurred: {error}.', Json::encode($error)); + if (is_array($error)) { + $error = Json::encode($error); + } + + Auth::error('An error occurred: {error}.', $error); throw new Exception('An error occurred.'); }