From b5f0fdd77290b2e658d6a072e58067a184b74bb0 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 27 Sep 2018 04:49:21 +0900 Subject: [PATCH] Update api.socialhub.php --- route/api.socialhub.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/route/api.socialhub.php b/route/api.socialhub.php index c64f55f..10d13f2 100644 --- a/route/api.socialhub.php +++ b/route/api.socialhub.php @@ -46,7 +46,7 @@ $hauth_session = null; $hauth_profile = null; // load library -$configfile = load_hybridauth($provider); +$configfile = hybridauth_load($provider); if(!$configfile) { set_error("can not load hybridauth library"); show_errors(); @@ -68,11 +68,13 @@ if(!empty($connection_id)) { } // check hybridauth request -if(check_hybridauth()) { - $hauth_session = $hauth->getSessionData(); - $connection_id = store_hybridauth_session($hauth_session, $user_id); - if($connection_id) { - $session_flag = true; +if(hybridauth_check_redirect()) { + if($hauth->isConnectedWith($provider)) { + $hauth_session = $hauth->getSessionData(); + $connection_id = store_hybridauth_session($hauth_session, $user_id); + if($connection_id) { + $session_flag = true; + } } } @@ -98,6 +100,10 @@ if(!$fw) { set_session("api_session_id", $api_session_id); } +if(hybridauth_check_redirect()) { + hybridauth_process(); +} + // try authenticate try { if(!$session_flag) {