lundi 29 février 2016

Redirect URL callback for facebook is not taking Base Url laravel 5

Hello everyone I'm trying to integrate facebook login using laravel5, In my code i have mentioned my redirect URL so it should go on below mentioned URL but when i'm trying to login with facebook my url is coming like this it's not taking my folder name see the difference in both URLs

 http://localhost:8000/facebook/callback?code=xxxxx

 Correct Url 
 http://localhost:8000/facebook/public/facebook/callback/

'facebook' => [
'client_id' => 'xxxxxxxxxxxxxxx',
'client_secret' => 'xxxxxxxxxxxxxxxxxxx',
'redirect' => 'http://localhost:8000/facebook/public/facebook/callback/',
 ],

This is my routes

Route::get('facebook/callback', 'Auth\AuthController@handleProviderCallback'); 

My controller

  public function handleProviderCallback()
{
    try {
        $user = Socialite::driver('facebook')->user();
    } catch (Exception $e) {
        return redirect('facebook');
    }

    $authUser = $this->findOrCreateUser($user);

    Auth::login($authUser, true);

    return redirect()->route('home');
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire