thephpleague / oauth2-client

Easy integration with OAuth 2.0 service providers.
http://oauth2-client.thephpleague.com
MIT License
3.64k stars 751 forks source link

"expires" is not set on the token #933

Open GauravMarvaha1993 opened 2 years ago

GauravMarvaha1993 commented 2 years ago

"expires" is not set on the token

GauravMarvaha1993 commented 2 years ago

image

GauravMarvaha1993 commented 2 years ago

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;
    }