Example #1
0
 /**
  * @param bool   $force
  * @param string $method
  * @return $this
  */
 public function refresh($force = false, $method = self::DEFAULT_METHOD)
 {
     if (true === $force || $this->identity->willExpiredIn(self::MARGIN_TIME)) {
         $data = ['grant_type' => 'refresh_token', 'refresh_token' => $this->identity->getRefreshToken()];
         $this->loadIdentity($data, $method);
     }
     return $this;
 }