From b90406e1d8161e856966d503ba625af9b91ea168 Mon Sep 17 00:00:00 2001 From: overtrue Date: Sun, 26 Sep 2021 09:55:48 +0800 Subject: [PATCH] Bugfix. --- src/Providers/OpenWeWork.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Providers/OpenWeWork.php b/src/Providers/OpenWeWork.php index 74d6f87..fbdf649 100644 --- a/src/Providers/OpenWeWork.php +++ b/src/Providers/OpenWeWork.php @@ -62,13 +62,14 @@ public function withSuiteAccessToken(string $suiteAccessToken): OpenWeWork public function getAuthUrl(): string { - $queries = [ + $queries = \array_filter([ 'appid' => $this->getClientId(), 'redirect_uri' => $this->redirectUrl, 'response_type' => 'code', 'scope' => $this->formatScopes($this->scopes, $this->scopeSeparator), 'state' => $this->state, - ]; + 'agentid' => $this->agentId, + ]); if ((\in_array('snsapi_userinfo', $this->scopes) || \in_array('snsapi_privateinfo', $this->scopes)) && empty($this->agentId)) { throw new InvalidArgumentException('agentid is required when scopes is snsapi_userinfo or snsapi_privateinfo.');