Laravel 5.5 Socialite Error

I have an issue with Socialite on Laravel 5.5 I have Socialite required by composer, updated services.php with different providers credential and updated providers in app.php This is the error I am getting

Type error: Argument 1 passed to Laravel\Socialite\SocialiteManager::formatRedirectUrl() must be of the type array, null given

Any help is highly appreciated.

Upvotes: 0

Views: 1164

Answers (2)

user320487
user320487

Reputation:

Check config/services.php for the provider you're authenticating with. The redirect entry needs to be set to your defined route.

'redirect' => 'http://your-callback-url'

Example:

// config.services.php
'github' => [
    'client_id' => env('GITHUB_CLIENT_ID'),   
    'client_secret' => env('GITHUB_CLIENT_SECRET'),
    'redirect' => 'http://example.com/github/redirect',
],

// routes/web.php
Route::get('github/redirect', 'GitHubController@redirect')

Upvotes: 1

Prince Lionel N'zi
Prince Lionel N'zi

Reputation: 2588

In most of the cases, the issue is solved through 3 steps:

  1. Run php artisan clear-compiled
  2. Run composer dump-autoload
  3. Run php artisan optimize

Hope it helps. Thanks.

Upvotes: 2

Related Questions