xhulio
xhulio

Reputation: 1103

Cartalyst Sentinel with Laravel Socialite conflict

I have a laravel app where I have integrated Cartalyst Sentinel and Laravel Socialite. Before integrating Laravel Socialite, the authentication worked perfectly. After integrating Socialite, first I had an InvalidStateException error on AbstractProvider.php line 200 when I call Socialite::driver('facebook')->user();

The following block is activated

if ($this->hasInvalidState()) {
        throw new InvalidStateException;
}

If I comment out the exception, I can login with facebook, however Sentinel does not recognized it as logged in. However when I check the users table on the database, the last_login timestamp is updated. Also when I try the normal authentication, a TokenMismatchException in VerifyCsrfToken.php line 67 appears. The {{csrf_field()}} is included inside the form, and when I remove the middleware from Kernel.php happens the same thing as with Laravel Socialite.

Important

The response is the correct eloquent user object, however when I do the check in the blade view, the check does not pass.

Any help is greatly appreciated

Upvotes: 2

Views: 482

Answers (0)

Related Questions