mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-30 09:15:02 +02:00
[DEV-161] Add apikey to ticket comment path (#1173)
* update ticket comment path * update validations * remove useless line
This commit is contained in:
parent
c64eb9930b
commit
f890fdc2d3
@ -42,8 +42,7 @@ class CommentController extends Controller {
|
||||
private $imagePaths;
|
||||
|
||||
public function validations() {
|
||||
$this->session = Session::getInstance();
|
||||
return [
|
||||
$validations = [
|
||||
'permission' => 'user',
|
||||
'requestData' => [
|
||||
'content' => [
|
||||
@ -56,6 +55,15 @@ class CommentController extends Controller {
|
||||
]
|
||||
]
|
||||
];
|
||||
if(Controller::request('captcha')){
|
||||
$validations['permission'] = 'any';
|
||||
$validations['requestData']['captcha'] = [
|
||||
'validation' => DataValidator::captcha(APIKey::TICKET_CREATE_PERMISSION),
|
||||
'error' => ERRORS::INVALID_CAPTCHA
|
||||
];
|
||||
}
|
||||
|
||||
return $validations;
|
||||
}
|
||||
|
||||
public function handler() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user