客户端错误:POST https://graph.facebook.com/v3.0/oauth/access_token
导致400 Bad Request
响应:{“错误”:{“消息”:“ \ u05d0 \ u05d9 \ u05df \ u05d0 \ u05e4 \ u05e9 \ u05e8 \ u05d5 \ u05ea \ u05dc \ u05d8 \ u05e2 \ u05d5 \ u05df \ u05d0 \ u05ea(截断...)
在laravel中安装社交名流包
public function Callback(Request $request, $provider)
{
try {
$userSocial = Socialite::driver($provider)->stateless()->user();
}
catch (Exception $e) {
return redirect ('/');
}
if (!$request->has('code') || $request->has('denied')) {
return redirect('/');
}
//$userSocial = Socialite::driver($provider)->stateless()->user();
$users = User::where(['email' => $userSocial->getEmail()])->first();
if($users){
Auth::login($users);
return redirect('/home');
}
else
{
$user = User::create([
'name' => $userSocial->getName(),
'email' => $userSocial->getEmail(),
'image' => $userSocial->getAvatar(),
'provider_id' => $userSocial->getId(),
'provider' => $provider,
]);
return redirect()->route('/home');
}
我们非常感谢您的帮助。