Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.11 release: PHP Fatal error: Declaration of SocialiteProviders\Okta\Provider::getRefreshTokenResponse(string $refreshToken) must be compatible with Laravel\Socialite\Two\AbstractProvider::getRefreshTokenResponse($refreshToken) #677

Closed
johanehnberg opened this issue Dec 5, 2023 · 1 comment

Comments

@johanehnberg
Copy link

Socialite Version

5.11

Laravel Version

10.35.0

PHP Version

8.1

Database Driver & Version

MySQL

Description

Looks like the new release may introduce some issues. 5.10 worked fine while 5.11 throws this in composer:


PHP Fatal error:  Declaration of SocialiteProviders\Okta\Provider::getRefreshTokenResponse(string $refreshToken) must be compatible with Laravel\Socialite\Two\AbstractProvider::getRefreshTokenResponse($refreshToken) in www/vendor/socialiteproviders/okta/Provider.php on line 132

   Symfony\Component\ErrorHandler\Error\FatalError 

  Declaration of SocialiteProviders\Okta\Provider::getRefreshTokenResponse(string $refreshToken) must be compatible with Laravel\Socialite\Two\AbstractProvider::getRefreshTokenResponse($refreshToken)

  at vendor/socialiteproviders/okta/Provider.php:132
    128▕      * @param string $refreshToken
    129▕      *
    130▕      * @return array
    131▕      */
  ➜ 132▕     public function getRefreshTokenResponse(string $refreshToken)
    133▕     {
    134▕         $response = $this->getHttpClient()->post($this->getTokenUrl(), [
    135▕             RequestOptions::AUTH        => [$this->clientId, $this->clientSecret],
    136▕             RequestOptions::HEADERS     => ['Cache-Control' => 'no-cache'],


   Whoops\Exception\ErrorException 

  Declaration of SocialiteProviders\Okta\Provider::getRefreshTokenResponse(string $refreshToken) must be compatible with Laravel\Socialite\Two\AbstractProvider::getRefreshTokenResponse($refreshToken)

  at vendor/socialiteproviders/okta/Provider.php:132
    128▕      * @param string $refreshToken
    129▕      *
    130▕      * @return array
    131▕      */
  ➜ 132▕     public function getRefreshTokenResponse(string $refreshToken)
    133▕     {
    134▕         $response = $this->getHttpClient()->post($this->getTokenUrl(), [
    135▕             RequestOptions::AUTH        => [$this->clientId, $this->clientSecret],
    136▕             RequestOptions::HEADERS     => ['Cache-Control' => 'no-cache'],

      +1 vendor frames 

  2   [internal]:0
      Whoops\Run::handleShutdown()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

Steps To Reproduce

composer upgrade

@johanehnberg johanehnberg changed the title 5,11 release: PHP Fatal error: Declaration of SocialiteProviders\Okta\Provider::getRefreshTokenResponse(string $refreshToken) must be compatible with Laravel\Socialite\Two\AbstractProvider::getRefreshTokenResponse($refreshToken) 5.11 release: PHP Fatal error: Declaration of SocialiteProviders\Okta\Provider::getRefreshTokenResponse(string $refreshToken) must be compatible with Laravel\Socialite\Two\AbstractProvider::getRefreshTokenResponse($refreshToken) Dec 5, 2023
@crynobone
Copy link
Member

The package needs to be updated to be compatible with 5.11 release: #675

Please submit the bug report to https://github.com/SocialiteProviders/Providers project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants