fix: [authkeys] allow for authkeys with no expiration set, fixes #169

perm_community_admin
iglocska 2024-06-07 14:04:24 +02:00
parent 7bbfb82e50
commit eabd56210a
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,9 @@ class AuthKeysController extends AppController
if (!in_array($data['user_id'], array_keys($users))) {
throw new MethodNotAllowedException(__('You are not authorised to do that.'));
}
if (empty($data['expiration'])) {
$data['expiration'] = 0;
}
return $data;
}
]);

View File

@ -16,6 +16,7 @@ echo $this->element('genericElements/Form/genericForm', [
'field' => 'expiration',
'label' => __('Expiration'),
'type' => 'datetime',
'required' => false
]
],
'submit' => [