0
Laravel 5.1에 Socialite 플러그인을 설치하는 데 큰 문제가 있습니다. 내 도메인을하려고 할 때Laravel 통합 사회자 5.1 InvalidState 문제
Route::get('/social/login/redirect/{provider}', ['uses' => 'Auth\[email protected]', 'as' => 'social.login']);
Route::get('/social/login/{provider}', 'Auth\[email protected]');
지금 :
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 :
먼저 나는이 AuthCOntroller.php 코드가 http://mydomain.me/social/login/redirect/facebook
나를 돌아:
http://mydomain.me/social/login/facebook?code=AQAl29aq2-rX9L5-9GmiIwqstR-ETC ETC ETC#_=_
여기서 어떤 문제가 발생합니까?
내가 시도 : 시도도 session.php에서 'mydomain.me'에 널 (null)에서 도메인을 변경하고 :
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan clear-compiled
말라가 다시 작동 ... 내가이 문제를 해결하기 위해 도와주세요!
아니요, 문제가 무엇인지 알지 못합니다 ... 10 일 동안이 문제를 해결하려고합니다 !!! –
내 질문에 아무런 대답도하지 않았습니다. – fire
1. 기본 로그인 작업이 좋습니다. 2. 예. .me/social/login/facebook 같은 쿼리 문자열을 봅니다. code = AQAl29aq2-rX9L5-9GmiIwqstR-ETC 기타 # _ = _ 3. fb 앱은 정상입니다. 모든 것이 평소와 같이 설정됩니다 ... 같은 코드 다른 응용 프로그램에서 잘 작동합니다. –