From 127ab00ab82978d5147c294e010499ead2a144b4 Mon Sep 17 00:00:00 2001 From: SuperDJ <6484766+SuperDJ@users.noreply.github.com> Date: Fri, 10 Jun 2022 09:49:59 +0200 Subject: [PATCH] Added new exception --- src/Runtime/Auth/AuthenticationContext.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Runtime/Auth/AuthenticationContext.php b/src/Runtime/Auth/AuthenticationContext.php index 375f6e5f..d9805524 100644 --- a/src/Runtime/Auth/AuthenticationContext.php +++ b/src/Runtime/Auth/AuthenticationContext.php @@ -135,6 +135,11 @@ public function authenticateRequest(RequestOptions $request) */ protected function ensureAuthorizationHeader(RequestOptions $options) { + if (isset($this->accessToken['error'])) + { + throw new Exception($this->accessToken['error_description']); + } + $value = $this->accessToken['token_type'] . ' ' . $this->accessToken['access_token']; $options->ensureHeader('Authorization', $value); }