Commit 9faf5044 by Klimov Paul

Fixed `\yii\authclient\OAuth2::refreshAccessToken()` does not save fetched token

parent e0b206a3
...@@ -4,6 +4,7 @@ Yii Framework 2 authclient extension Change Log ...@@ -4,6 +4,7 @@ Yii Framework 2 authclient extension Change Log
2.0.2 under development 2.0.2 under development
----------------------- -----------------------
- Bug #6502: Fixed `\yii\authclient\OAuth2::refreshAccessToken()` does not save fetched token (sebathi)
- Bug #6510: Fixed infinite redirect loop using default `\yii\authclient\AuthAction::cancelUrl` (klimov-paul) - Bug #6510: Fixed infinite redirect loop using default `\yii\authclient\AuthAction::cancelUrl` (klimov-paul)
......
...@@ -158,7 +158,10 @@ class OAuth2 extends BaseOAuth ...@@ -158,7 +158,10 @@ class OAuth2 extends BaseOAuth
$params = array_merge($token->getParams(), $params); $params = array_merge($token->getParams(), $params);
$response = $this->sendRequest('POST', $this->tokenUrl, $params); $response = $this->sendRequest('POST', $this->tokenUrl, $params);
return $response; $token = $this->createToken(['params' => $response]);
$this->setAccessToken($token);
return $token;
} }
/** /**
......
...@@ -50,6 +50,9 @@ class OAuthToken extends Object ...@@ -50,6 +50,9 @@ class OAuthToken extends Object
private $_params = []; private $_params = [];
/**
* @inheritdoc
*/
public function init() public function init()
{ {
if ($this->createTimestamp === null) { if ($this->createTimestamp === null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment