I have searched online for solution to his problem, but i am yet to find a fix. please i need help..
I get this error :
OAuth \ Common \ Http \ Exception \ TokenResponseException
Failed to request resource.
Below is my code, if i am doing anything wrong then please help spot it... I have tried using my Redirect URL manually but it still gives the same error..
public function loginWithGoogle()
{
$code= Input::get('code');
$googleService = OAuth::consumer('Google');
if (!empty($code)){
$token= $googleService->requestAccessToken($code);
$result= json_decode($googleService->request('https://www.googleapis.com/oauth2/v1/userinfo' ), true);
} else {
// get googleService authorization
$url = $googleService->getAuthorizationUri();
// return to google login url
return Redirect::to( (string)$url );
}
I have searched online for solution to his problem, but i am yet to find a fix. please i need help..
I get this error : OAuth \ Common \ Http \ Exception \ TokenResponseException Failed to request resource.
Below is my code, if i am doing anything wrong then please help spot it... I have tried using my Redirect URL manually but it still gives the same error..
public function loginWithGoogle() {
}