hybridauth-无法恢复谷歌登录

hybridauth-无法恢复谷歌登录,hybridauth,Hybridauth,我已经用HybridAuth制作了登录脚本。我在我的网站上登录了“提供商”Facebook、Google、Twitter。当PHP会话超时时,我想恢复连接的“提供者” 我使用以下代码: $connected_adapters_list = $hybridauth->getConnectedProviders(); if( count( $connected_adapters_list ) ){ foreach( $connect

我已经用HybridAuth制作了登录脚本。我在我的网站上登录了“提供商”Facebook、Google、Twitter。当PHP会话超时时,我想恢复连接的“提供者”

我使用以下代码:

    $connected_adapters_list = $hybridauth->getConnectedProviders(); 
          if( count( $connected_adapters_list ) ){
                foreach( $connected_adapters_list as $adapter_id ){
                    echo  $adapter_id . "<br>";
          }
    }
   try{
       $hybridauth = new Hybrid_Auth( $config );

        $adapter = $hybridauth->authenticate( "Google" );
        $user_profile = $adapter->getUserProfile();

   }
   catch( Exception $e ){
        $hybridauth->logoutAllProviders();
        $hybridauth = new Hybrid_Auth( $config );          
        $adapter = $hybridauth->authenticate( "Google" );
        $user_profile = $adapter->getUserProfile();
   }
}

我也有这个问题,

它可以通过使用“logoutAllProviders()”函数来解决

代码如下:

   try{
       $hybridauth = new Hybrid_Auth( $config );

        $adapter = $hybridauth->authenticate( "Google" );
        $user_profile = $adapter->getUserProfile();

   }
   catch( Exception $e ){
        $hybridauth->logoutAllProviders();
        $hybridauth = new Hybrid_Auth( $config );          
        $adapter = $hybridauth->authenticate( "Google" );
        $user_profile = $adapter->getUserProfile();
   }
}

祝你好运

我也有这个问题

它可以通过使用“logoutAllProviders()”函数来解决

代码如下:

   try{
       $hybridauth = new Hybrid_Auth( $config );

        $adapter = $hybridauth->authenticate( "Google" );
        $user_profile = $adapter->getUserProfile();

   }
   catch( Exception $e ){
        $hybridauth->logoutAllProviders();
        $hybridauth = new Hybrid_Auth( $config );          
        $adapter = $hybridauth->authenticate( "Google" );
        $user_profile = $adapter->getUserProfile();
   }
}
祝你好运