From e448651e071a05a6ee37b20ee707c0b419f44f55 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Thu, 24 Aug 2017 11:10:35 +0200 Subject: [PATCH] Client API: add response on successful authorisation --- auth.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/auth.php b/auth.php index 6d324cd..5ee2d45 100755 --- a/auth.php +++ b/auth.php @@ -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 */ }