From 49a1904eaec547dd8e0a10f3c863f9003f2faccd Mon Sep 17 00:00:00 2001 From: amazuecos Date: Mon, 10 Feb 2025 18:11:46 +0100 Subject: [PATCH] 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