Answer the question
In order to leave comments, you need to log in
Laravel and authorization through VKontakte, why does an error sometimes appear?
Connected socialiteproviders.github.io/providers/vkontakte
But sometimes an error appears:
ClientException in RequestException.php line 111:
Client error: `POST https://oauth.vk.com/access_token` resulted in a `401 Unauthorized` response:
{"error":"invalid_grant","error_description":"Code is invalid or expired."}
Answer the question
In order to leave comments, you need to log in
You are using authorization incorrectly.
You can get an access_token via oauth only once. All subsequent requests will return an error.
For a solution, you can hang a try ... catch handler and, in the event of a ClientException, re-initialize authorization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question