From c7de18f4792964cd155efdd42f43c04195cab7ec Mon Sep 17 00:00:00 2001 From: rotexdegba Date: Fri, 8 Dec 2023 11:19:49 -0700 Subject: [PATCH] Testing & refactoring in progress --- src/controllers/BaseController.php | 2 +- tests/BaseControllerTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/BaseController.php b/src/controllers/BaseController.php index 43a30bb..a100331 100644 --- a/src/controllers/BaseController.php +++ b/src/controllers/BaseController.php @@ -636,7 +636,7 @@ public function actionLogin() { if( ($error_msg === '') ) { $credentials = [ - 'username'=> filter_var($username, FILTER_SANITIZE_STRING), + 'username'=> filter_var($username, FILTER_UNSAFE_RAW), 'password'=> $password, //Not sanitizing this. Sanitizing or //validating passwords should be app //specific & done during user creation. diff --git a/tests/BaseControllerTest.php b/tests/BaseControllerTest.php index c66ade1..e0b4f34 100644 --- a/tests/BaseControllerTest.php +++ b/tests/BaseControllerTest.php @@ -1127,6 +1127,9 @@ public function testThat_doLogin_WorksAsExpected() { $psr11Container, 'da-controller', 'da-action', $req, $resp ); + //////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////// + $success_redirect_path = '/random-path'; $expected_redirect_path = $_SESSION[\SMVCTools\Tests\TestObjects\ControllerWithPublicDoLogin::SESSN_PARAM_LOGIN_REDIRECT];