From 656e5fd052d0ee1e9161e25090b54be70d4880ba Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 8 Dec 2015 20:42:46 -0800 Subject: use killme() instead of die() so that any sessions are closed cleanly. --- include/api_auth.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/api_auth.php b/include/api_auth.php index ee9db3f55..b78c69bac 100644 --- a/include/api_auth.php +++ b/include/api_auth.php @@ -1,6 +1,6 @@ "; // var_dump($consumer, $token); - die(); + killme(); } catch(Exception $e) { logger(__file__.__line__.__function__."\n".$e); @@ -56,7 +56,8 @@ function api_login(&$a){ logger('API_login: ' . print_r($_SERVER,true), LOGGER_DEBUG); header('WWW-Authenticate: Basic realm="Red"'); header('HTTP/1.0 401 Unauthorized'); - die('This api requires login'); + echo('This api requires login'); + killme(); } // process normal login request @@ -81,7 +82,8 @@ function api_login(&$a){ logger('API_login failure: ' . print_r($_SERVER,true), LOGGER_DEBUG); header('WWW-Authenticate: Basic realm="Red"'); header('HTTP/1.0 401 Unauthorized'); - die('This api requires login'); + echo('This api requires login'); + killme(); } } -- cgit v1.2.3