From 0ce3285293026a639de317a70b01eeef051e9962 Mon Sep 17 00:00:00 2001 From: overtrue Date: Fri, 13 Nov 2020 07:23:15 +0800 Subject: [PATCH] Fixed #203 #197 overtrue/wechat#1956 --- src/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/User.php b/src/User.php index 44b078a..761ac8f 100644 --- a/src/User.php +++ b/src/User.php @@ -103,8 +103,8 @@ public function setToken(AccessTokenInterface $token) $this->setAttribute('token', $token->getToken()); $this->setAttribute('access_token', $token->getToken()); - if (!empty($token['refresh_token'])) { - $this->setAttribute('refresh_token', $token['refresh_token']); + if (\is_callable([$token, 'getRefreshToken'])) { + $this->setAttribute('refresh_token', $token->getRefreshToken()); } return $this;