From fb907a07d021e80ced6b59d1bfaf45bdec0be5fb Mon Sep 17 00:00:00 2001 From: Mal Boston Date: Mon, 18 Jan 2021 14:31:08 +0000 Subject: [PATCH] Update validation rules to take into account other keys being returned --- src/Authentication.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Authentication.php b/src/Authentication.php index 0b1fcab..97b28b5 100644 --- a/src/Authentication.php +++ b/src/Authentication.php @@ -137,11 +137,20 @@ private function validateAuthentication($auth = null): bool 'expires_in', 'access_token', 'refresh_token', - 'user', - 'api_version' + 'user' ]; - return $auth && array_keys($auth) === $matchingKeys; + if (!$auth) { + return false; + } + + foreach ($matchingKeys as $key) { + if (!array_key_exists($key, $auth)) { + return false; + } + } + + return true; } } \ No newline at end of file