Laravel Socialite: InvalidStateException

后端 未结 25 1155
感动是毒
感动是毒 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:16

    I want to share you my solution . I go to my AbstractProvider.php file and in the line of problem

    public function user()
    {
        if ($this->hasInvalidState()) {
            throw new InvalidStateException;
        }
    
        // ...
    }
    

    I stop the throw new InvalidStateException and call the redirect function like that:

    public function user()
    {
        if ($this->hasInvalidState()) {
            $this->redirect();
            // throw new InvalidStateException;
        }
    
        // ...
    }
    

提交回复
热议问题