fix: [error code] adding an authkey for a user you are not authorised to modify resulted in a 404 instead of a 405

pull/92/head
iglocska 2022-02-20 14:56:21 +01:00
parent 2ef2dbbe62
commit c005cb7f66
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ class AuthKeysController extends AppController
'displayOnSuccess' => 'authkey_display',
'beforeSave' => function($data) use ($users) {
if (!in_array($data['user_id'], array_keys($users))) {
return false;
throw new MethodNotAllowedException(__('You are not authorised to do that.'));
}
return $data;
}