我使用HybridIgniter(HybridAuth for Codeigniter)。如果我尝试使用Facebook登录然后我拒绝批准该应用程序,则会收到以下错误:
Fatal error: Uncaught exception 'Exception' with message 'Authentification failed! The user denied your request.' in /usr/local/psa/home/vhosts/whatabeer.com/httpdocs/application_cdb/website/third_party/hybridauth/Hybrid/Providers/Facebook.php:80 Stack trace: #0 /usr/local/psa/home/vhosts/whatabeer.com/httpdocs/application_cdb/website/third_party/hybridauth/Hybrid/Endpoint.php(175): Hybrid_Providers_Facebook->loginFinish() #1 /usr/local/psa/home/vhosts/whatabeer.com/httpdocs/application_cdb/website/third_party/hybridauth/Hybrid/Endpoint.php(56): Hybrid_Endpoint::processAuthDone() #2 /usr/local/psa/home/vhosts/whatabeer.com/httpdocs/application_cdb/website/third_party/hybridauth/index.php(15): Hybrid_Endpoint::process() #3 /usr/local/psa/home/vhosts/whatabeer.com/httpdocs/application_cdb/website/modules/hauth/controllers/hauth.php(254): require_once('/usr/local/psa/...') #4 [internal function]: HAuth->endpoint() #5 /usr/local/psa/home/vhosts/whatabeer.com/httpdocs/system_cdb/core/CodeIgniter.php(359): call_user_func_array( in /usr/local/psa/home/vhosts/whatabeer.com/httpdocs/application_cdb/website/third_party/hybridauth/Hybrid/Auth.php on line 153
我使用Codeigniter 2.1.4与HMVC和HybridAuth 2.1.0
答案 0 :(得分:0)
HybridAuth docs说它是预期的行为(http://hybridauth.sourceforge.net/userguide/Errors_and_Exceptions_Handling.html):
由于2.0 HybridAuth主要处理异常,只需将代码抛入try {} catch(Exception $ e){}块即可。