thephpleague / oauth2-client

Easy integration with OAuth 2.0 service providers.

Home Page:http://oauth2-client.thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"expires" is not set on the token

GauravMarvaha1993 opened this issue · comments

"expires" is not set on the token

if (isset($options['expires_in'])) {
if (!is_numeric($options['expires_in'])) {
throw new \InvalidArgumentException('expires_in value must be an integer');
}

        $this->expires = $options['expires_in'] != 0 ? $this->getTimeNow() + $options['expires_in'] : 0;
    } elseif (!empty($options['expires'])) {
        // Some providers supply the seconds until expiration rather than
        // the exact timestamp. Take a best guess at which we received.
        $expires = $options['expires'];

        if (!$this->isExpirationTimestamp($expires)) {
            $expires += $this->getTimeNow();
        }

        $this->expires = $expires;
    }