Answer the question
In order to leave comments, you need to log in
Why doesn't Laravel Socialite call getAccessToken()?
I decided to use Socialite and installed a provider for VK. After allowing access from Vkontakte, I am redirected to a callback link and displays this.
How to fix. Who faced?
Answer the question
In order to leave comments, you need to log in
Corrected. The provider /vendor/laravel/socialite/src/Two/AbstractProvider.php was missing a function:
public function getAccessToken($code)
{
$postKey = (version_compare(ClientInterface::VERSION, '6') === 1) ? 'form_params' : 'body';
$response = $this->getHttpClient()->post($this->getTokenUrl(), [
'headers' => ['Accept' => 'application/json'],
$postKey => $this->getTokenFields($code),
]);
$this->credentialsResponseBody = json_decode($response->getBody(), true);
return $this->parseAccessToken($response->getBody());
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question