From 49a1904eaec547dd8e0a10f3c863f9003f2faccd Mon Sep 17 00:00:00 2001 From: amazuecos Date: Mon, 10 Feb 2025 18:11:46 +0100 Subject: [PATCH 1/2] fix login redirect ajax request --- ci4/app/Config/Auth.php | 10 ++++++++-- httpdocs/assets/js/safekat/pages/chatNotification.js | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ci4/app/Config/Auth.php b/ci4/app/Config/Auth.php index a1b84866..4d265628 100644 --- a/ci4/app/Config/Auth.php +++ b/ci4/app/Config/Auth.php @@ -440,8 +440,14 @@ class Auth extends ShieldAuth public function loginRedirect(): string { $session = session(); - $url = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login']; - + $url = setting('Auth.redirects')['login']; + if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])){ + if($_SERVER['HTTP_X_REQUESTED_WITH'] == "httpxmlrequest"){ + $url = setting('Auth.redirects')['login']; + } + }else{ + $url = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login']; + } return $this->getUrl($url); } diff --git a/httpdocs/assets/js/safekat/pages/chatNotification.js b/httpdocs/assets/js/safekat/pages/chatNotification.js index 333dba83..060d824d 100644 --- a/httpdocs/assets/js/safekat/pages/chatNotification.js +++ b/httpdocs/assets/js/safekat/pages/chatNotification.js @@ -11,6 +11,5 @@ $(() => { }) $("#btn-log-out").on("click",() => { clearInterval(chatNotificationInterval) - console.log("CLEAR") }) }) \ No newline at end of file From 97a05d5568de141558f6f25ad329523f323bcf77 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Mon, 10 Feb 2025 18:16:16 +0100 Subject: [PATCH 2/2] fix xmlhttprequest --- ci4/app/Config/Auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci4/app/Config/Auth.php b/ci4/app/Config/Auth.php index 4d265628..decc5ba3 100644 --- a/ci4/app/Config/Auth.php +++ b/ci4/app/Config/Auth.php @@ -442,7 +442,7 @@ class Auth extends ShieldAuth $session = session(); $url = setting('Auth.redirects')['login']; if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])){ - if($_SERVER['HTTP_X_REQUESTED_WITH'] == "httpxmlrequest"){ + if($_SERVER['HTTP_X_REQUESTED_WITH'] == "xmlhttprequest"){ $url = setting('Auth.redirects')['login']; } }else{