mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Убраны разрознености в ошибках, скорреткированы тесты
This commit is contained in:
@ -46,7 +46,7 @@ class ForgotPasswordForm extends ApiForm {
|
||||
if (!$this->hasErrors()) {
|
||||
$emailConfirmation = $this->getEmailActivation();
|
||||
if ($emailConfirmation !== null && !$emailConfirmation->canRepeat()) {
|
||||
$this->addError($attribute, 'error.email_frequency');
|
||||
$this->addError($attribute, 'error.recently_sent_message');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class RegistrationForm extends ApiForm {
|
||||
public function rules() {
|
||||
return [
|
||||
[[], ReCaptchaValidator::class, 'message' => 'error.captcha_invalid', 'when' => !YII_ENV_TEST],
|
||||
['rulesAgreement', 'required', 'message' => 'error.you_must_accept_rules'],
|
||||
['rulesAgreement', 'required', 'message' => 'error.rulesAgreement_required'],
|
||||
|
||||
['username', 'validateUsername', 'skipOnEmpty' => false],
|
||||
['email', 'validateEmail', 'skipOnEmpty' => false],
|
||||
|
@ -13,7 +13,7 @@ class KeyConfirmationForm extends ApiForm {
|
||||
public function rules() {
|
||||
return [
|
||||
// TODO: нужно провалидировать количество попыток ввода кода для определённого IP адреса и в случае чего запросить капчу
|
||||
['key', 'required', 'message' => 'error.key_is_required'],
|
||||
['key', 'required', 'message' => 'error.key_required'],
|
||||
['key', EmailActivationKeyValidator::class],
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user