Skip to content

Commit 4034373

Browse files
author
Phan Van Thanh
committed
Fix PKF-369: check null when get access token in getUserInfo function
1 parent 8d27499 commit 4034373

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fproject/authclient/OAuth2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ public function verifyAndDecodeToken($token, $checkRevoked=true)
198198
public function getUserInfo($accessToken=null, $cacheDuration=-1)
199199
{
200200
/** @var string $cacheKey */
201-
if($accessToken == null)
202-
$accessToken = $this->getAccessToken()->token;
201+
if($accessToken == null && !empty($at = $this->getAccessToken()))
202+
$accessToken = $at->token;
203203

204204
$userInfo = null;
205205

0 commit comments

Comments
 (0)