mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-20 03:38:06 +02:00
Reject group creation with reserved 'All' name
This commit is contained in:
parent
180f8e3448
commit
ceb9d69478
@ -30,8 +30,21 @@ class GroupStoreRequest extends FormRequest
|
|||||||
'required',
|
'required',
|
||||||
'regex:/^[A-zÀ-ú0-9\s\-_]+$/',
|
'regex:/^[A-zÀ-ú0-9\s\-_]+$/',
|
||||||
'max:32',
|
'max:32',
|
||||||
|
Rule::notIn([__('commons.all')]),
|
||||||
Rule::unique('groups')->where(fn ($query) => $query->where('user_id', $this->user()->id)),
|
Rule::unique('groups')->where(fn ($query) => $query->where('user_id', $this->user()->id)),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the error messages for the defined validation rules.
|
||||||
|
*
|
||||||
|
* @return array<string, string>
|
||||||
|
*/
|
||||||
|
public function messages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name.not_in' => __('errors.reserved_name_please_choose_something_else'),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,5 @@ return [
|
|||||||
'qrcode_has_invalid_checksum' => 'QR code has invalid checksum',
|
'qrcode_has_invalid_checksum' => 'QR code has invalid checksum',
|
||||||
'no_readable_qrcode' => 'No readable QR code',
|
'no_readable_qrcode' => 'No readable QR code',
|
||||||
'failed_icon_store_database_toggling' => 'Migration of icons failed. The setting has been restored to its previous value.',
|
'failed_icon_store_database_toggling' => 'Migration of icons failed. The setting has been restored to its previous value.',
|
||||||
|
'reserved_name_please_choose_something_else' => 'Reserved name, please choose something else',
|
||||||
];
|
];
|
Loading…
x
Reference in New Issue
Block a user