Shield Not Displaying error messages on invalid username and password |
I have the lastest versions of CI (4.5.1) and Sheild (1.0.3) installed.
When a user attempts to login with an invalid password no error messages are displayed. It simply reloads the login screen blank. I have customised the view but this is the same if I use my customised view or the one that comes 'out of the box'. Does anyone have any ideas? Am I missing something really simple (probable!)
Enable the debugging tool(CI_ENVIRONMENT = development).
Go to the Vars tab. See if there is a value for the error variable. If the error value is displayed, then you have a problem with the view configuration. Make sure the following code is in the view: PHP Code: <?php if (session('error') !== null) : ?> (05-22-2024, 09:47 PM)datamweb Wrote: Enable the debugging tool(CI_ENVIRONMENT = development). It doesn't work. Session messages are dropped when redirect to form page. If u watch in debugbar, u see that u're last request record having type GET and previously record is POST. Load previously record and see session messages in Vars tab. Now u can see, messages are dropped somewhere between login action and showing form.
I think the problem is related to the user's redirect method.
I tried to repeat the problem with the default Home controller. The problem repeats if I use the same redirection principle as in Shield controllers. If i explicitly specify Location as a redirection method in the to() method of the call chain, the message is saved and displayed correctly. Perhaps the problem is in the environment, because for the current project i have to use IIS. For repeat problem i use this code: PHP Code: if ($this->request->getGet('test')) {
05-27-2024, 10:35 AM
(This post was last modified: 05-30-2024, 08:52 AM by WitER. Edit Reason: Update )
At the moment, I have come to the conclusion that the problem with resetting flash messages in a session when redirecting is being reproduced due to the injection of Kint code into the response body.
But unfortunately, I have not figure out how to disable injection in the presence of a redirect request. UPD: Figured it out, sent a report. |
Welcome Guest, Not a member yet? Register Sign In |