Client API: add response on successful authorisation

This commit is contained in:
Bartek Fabiszewski 2017-08-24 11:10:35 +02:00
parent 18fa942259
commit e448651e07

View File

@ -111,8 +111,12 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('client')))
session_name('ulogger');
session_start();
$user->storeInSession();
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
header("Location: $ssl://$url");
if (!defined('client')) {
// redirect
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
header("Location: $ssl://$url");
exit();
}
} else {
// unsuccessful
$error = "?auth_error=1";
@ -130,8 +134,8 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('client')))
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
header("Location: $ssl://$url$error");
}
exit();
}
exit();
}
/* end of authentication */
}