Keep on getting error about max_byte |
Hi everyone and thanks in advance,
I'm working with CodeIgniter 4 and Shield, but every time I try to use max_byte rule I get this error: PHP Code: CodeIgniter\Validation\Exceptions\ValidationException This is happening on Login, where I'm using the config suggested in Shield documentation: PHP Code: public $login = [
max_byte validation is part of \shield\Authentication\Passwords\ValidationRules.php.
If you look at the comments in \shield\Authentication\Passwords\ValidationRules.php, it states that if you want to use that class you have to add it to Config/Validation.php in the $rulesets array. Modify the config/Validation.php file like this (according to ChatGPT): PHP Code: <?php
Hi ,Try :
PHP Code: use CodeIgniter\Shield\Authentication\Passwords;
@JustJohnQ 's reply worked, but I added
PHP Code: use CodeIgniter\Shield\Authentication\Passwords\ValidationRules; I cannot find it from github, but do not you think that it would be better to add this rule to the ruleset by default since max_byte is already present in the login rules? Thanks you guys! (08-16-2024, 07:20 AM)Fabio-Zeus-Soft Wrote: I cannot find it from github, but do not you think that it would be better to add this rule to the ruleset by default since max_byte is already present in the login rules? The "CodeIgniter\Shield\Authentication\Passwords\ValidationRules" is added by Registrar. See - https://github.com/codeigniter4/shield/b...istrar.php - https://www.codeigniter.com/user_guide/g...registrars So by default, you don't need to add it manually. But if you disable Auto-Discovery of registrars, you need to add the rule manually. See - https://www.codeigniter.com/user_guide/g...-discovery |
Welcome Guest, Not a member yet? Register Sign In |