I’m using Laravel Socialite in my project for google login.
public function handleProviderCallback(): RedirectResponse
{
$provider = Socialite::driver('google')->scopes(['openid', 'email']);
$provider->redirectUrl(URL('oauth/google/callback'));
$oAuthUser = $provider->stateless()->user();
the above method works fine most of the time, but every once in a while i get an error
Client error: POST https://www.googleapis.com/oauth2/v4/token
resulted in a 400 Bad Request
response: { “error”: “invalid_request”, “error_description”: “Missing required parameter: code” }
I’m unable to reproduce this in local. please me to figure out how to fix this ?
->scopes(['openid', 'email'])
was later added to fix this but failed to fix it.