-
I trying to login with username instead so I have done the following modifications; Config/Auth.php public array $validFields = [
//'email',
'username',
]; Validation/ValidationRules.php public function getLoginRules(): array
{
return setting('Validation.login') ?? [
'username' => $this->config->usernameValidationRules,
//'email' => $this->config->emailValidationRules,
'password' => $this->getPasswordRules(),
];
} Views/login.php <div class="form-floating mb-3">
<input type="text" class="form-control" id="floatingUsernameInput" name="username" inputmode="text" autocomplete="username" placeholder="<?= lang('Auth.username') ?>" value="<?= old('username') ?>" required>
<label for="floatingUsernameInput"><?= lang('Auth.username') ?></label>
</div> app/Config/Validation.php //--------------------------------------------------------------------
// Rules For Login
//--------------------------------------------------------------------
public $login = [
'username' => [
'label' => 'Auth.username',
'rules' => 'required|max_length[30]|min_length[3]|regex_match[/\A[a-zA-Z0-9\.]+\z/]|check_username_capital_letters',
],
//'email' => [
// 'label' => 'Auth.email',
// 'rules' => 'required|max_length[254]|valid_email|check_email_capital_letters',
// ],
'password' => [
'label' => 'Auth.password',
'rules' => 'required|max_byte[72]|strong_password|check_password_composition',
'errors' => [
'max_byte' => 'Auth.errorPasswordTooLongBytes',
]
],
]; but as soon I try to login with username and password then I get this error Uising Shield 1.1.0 and CI 4.5.3 Any ideas please? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
datamweb
Sep 28, 2024
Replies: 1 comment 1 reply
-
To resolve the issue, please remove the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mel9pr1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To resolve the issue, please remove the
strong_password
rule from the password validation rules.