From a20f2e9e33fb775a1f40ff0eb66328f9de888388 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 6 Nov 2021 16:51:36 +0100 Subject: [PATCH] Corrected the login HTTP callback --- application/controllers/User.php | 2 +- assets/js/login.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/User.php b/application/controllers/User.php index a5190c39..af27ce5d 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -115,7 +115,7 @@ class User extends EA_Controller { session($user_data); // Save data in the session. - json_encode([ + json_response([ 'success' => TRUE, ]); } diff --git a/assets/js/login.js b/assets/js/login.js index f3b81b10..c7beb88a 100644 --- a/assets/js/login.js +++ b/assets/js/login.js @@ -37,7 +37,7 @@ $(function () { $.post(url, data) .done(function (response) { - if (response === GlobalVariables.AJAX_SUCCESS) { + if (response.success) { window.location.href = GlobalVariables.destUrl; } else { $alert.text(EALang['login_failed']);