I am using Moodle 3.1+. I have used google auth2 for facebook login. It was working fine before. But now it is showing the exception "Required option not passed: access_token" while trying to access the token. Below code generates the exception.
$token = $provider->getAccessToken('authorization_code', [
'code' => $code
]);