Laravel Socialite: InvalidStateException

后端 未结 25 1206
感动是毒
感动是毒 2020-11-27 13:56

I\'m using Laravel Socialite to add a Facebook connect button on a website. Sometimes, I\'ve got this error on callback:

exception \'Laravel\\Socialite\\Two\         


        
25条回答
  •  青春惊慌失措
    2020-11-27 14:27

    I've got same happen only when I open my web on mobile and open the dialog by facebook application on my phone.

    I think: This happen because open facebook app to get response from Facebook API make we lost some cookie. it's become stateless. Then I just use the option that socialite are already made to avoid stateless request.

    $user = Socialite::driver($provider)->stateless()->user();
    

    It's worked to me. hope it help you

提交回复
热议问题