Update api.socialhub.php

This commit is contained in:
Namhyeon Go 2018-09-27 04:49:21 +09:00 committed by GitHub
parent fa37ad387b
commit b5f0fdd772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ $hauth_session = null;
$hauth_profile = null; $hauth_profile = null;
// load library // load library
$configfile = load_hybridauth($provider); $configfile = hybridauth_load($provider);
if(!$configfile) { if(!$configfile) {
set_error("can not load hybridauth library"); set_error("can not load hybridauth library");
show_errors(); show_errors();
@ -68,11 +68,13 @@ if(!empty($connection_id)) {
} }
// check hybridauth request // check hybridauth request
if(check_hybridauth()) { if(hybridauth_check_redirect()) {
$hauth_session = $hauth->getSessionData(); if($hauth->isConnectedWith($provider)) {
$connection_id = store_hybridauth_session($hauth_session, $user_id); $hauth_session = $hauth->getSessionData();
if($connection_id) { $connection_id = store_hybridauth_session($hauth_session, $user_id);
$session_flag = true; if($connection_id) {
$session_flag = true;
}
} }
} }
@ -98,6 +100,10 @@ if(!$fw) {
set_session("api_session_id", $api_session_id); set_session("api_session_id", $api_session_id);
} }
if(hybridauth_check_redirect()) {
hybridauth_process();
}
// try authenticate // try authenticate
try { try {
if(!$session_flag) { if(!$session_flag) {