From a5a09df926ba3265a19ef1527ff42b9cd2952620 Mon Sep 17 00:00:00 2001 From: Nikita Date: Fri, 20 Sep 2019 21:08:47 +0300 Subject: [PATCH] button update --- example.php | 5 +++-- src/AmoCRM.php | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/example.php b/example.php index 713cb48..9d2fb3f 100644 --- a/example.php +++ b/example.php @@ -32,7 +32,7 @@ '; + die; } else { $authorizationUrl = $provider->getAuthorizationUrl(); header('Location: ' . $authorizationUrl); } - } elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + } elseif (empty($_GET['state']) || empty($_SESSION['oauth2state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { unset($_SESSION['oauth2state']); exit('Invalid state'); } diff --git a/src/AmoCRM.php b/src/AmoCRM.php index 7223b06..784c4cf 100644 --- a/src/AmoCRM.php +++ b/src/AmoCRM.php @@ -67,6 +67,14 @@ public function getBaseDomain() return $this->baseDomain; } + /** + * @return string + */ + public function getClientId() + { + return $this->clientId; + } + /** * Get authorization url to begin OAuth flow *