Welcome Guest, Not a member yet? Register   Sign In
Shield Not Displaying error messages on invalid username and password
#3

(05-22-2024, 09:47 PM)datamweb Wrote: 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) : ?>
                    <div class="alert alert-danger" role="alert"><?= session('error'?></div>
                <?php elseif (session('errors') !== null) : ?>
                    <div class="alert alert-danger" role="alert">
                        <?php if (is_array(session('errors'))) : ?>
                            <?php foreach (session('errors') as $error) : ?>
                                <?= $error ?>
                                <br>
                            <?php endforeach ?>
                        <?php else : ?>
                            <?= session('errors'?>
                        <?php endif ?>
                    </div>
                <?php endif ?>

                <?php if (session('message') !== null) : ?>
                <div class="alert alert-success" role="alert"><?= session('message'?></div>
                <?php endif ?>

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.
Reply


Messages In This Thread
RE: Shield Not Displaying error messages on invalid username and password - by WitER - 05-26-2024, 04:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB