我在Laravel 5.1上安装名流插件时遇到了一个问题。
首先,我有这个AuthCOntroller.php代码:
public function redirectToProvider($provider)
{
return Socialite::driver($provider)->redirect();
}
public function handleProviderCallback($provider)
{
//notice we are not doing any validation, you should do it
$user = Socialite::driver($provider)->user();
// stroing data to our use table and logging them in
$data = [
'name' => $user->getName(),
'email' => $user->getEmail()
];
// Here, check if the user already exists in your records
$my_user = User::where('email','=', $user->getEmail())->first();
if($my_user === null) {
Auth::login(User::firstOrCreate($data));
} else {
Auth::login($my_user);
}
//after login redirecting to home page
return redirect($this->redirectPath());
}和route.php:
Route::get('/social/login/redirect/{provider}', ['uses' => 'Auth\AuthController@redirectToProvider', 'as' => 'social.login']);
Route::get('/social/login/{provider}', 'Auth\AuthController@handleProviderCallback');现在当我尝试我的域名:http://mydomain.me/social/login/redirect/facebook
还给我:
http://mydomain.me/social/login/facebook?code=AQAl29aq2-rX9L5-9GmiIwqstR-ETC ETC ETC#_=_和错误:

这里的问题是什么?
我尝试在session.php中将域名从null更改为'mydomain.me‘,也尝试了:
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan clear-compiled这不再起作用了。
发布于 2016-08-30 17:37:14
/social/login/facebook中得不到state查询字符串你能确认你能在重定向网址中看到查询字符串(即当你看到facebook登录页面时)吗?https://stackoverflow.com/questions/39223584
复制相似问题