@@ -65,12 +65,6 @@ public function __construct(
6565
6666 public function addAction (): ResponseInterface
6767 {
68- $ this ->denyRequest (
69- ! $ this ->isGet () || ! $ this ->isPost (),
70- Message::METHOD_NOT_ALLOWED ,
71- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
72- );
73-
7468 if ($ this ->isPost ()) {
7569 $ this ->adminForm ->setData ($ this ->getPostParams ());
7670 if ($ this ->adminForm ->isValid ()) {
@@ -114,12 +108,6 @@ public function addAction(): ResponseInterface
114108
115109 public function editAction (): ResponseInterface
116110 {
117- $ this ->denyRequest (
118- ! $ this ->isGet () || ! $ this ->isPost (),
119- Message::METHOD_NOT_ALLOWED ,
120- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
121- );
122-
123111 $ uuid = $ this ->getAttribute ('uuid ' );
124112
125113 /** @var Admin $admin */
@@ -173,12 +161,6 @@ public function editAction(): ResponseInterface
173161
174162 public function deleteAction (): ResponseInterface
175163 {
176- $ this ->denyRequest (
177- ! $ this ->isDelete (),
178- Message::METHOD_NOT_ALLOWED ,
179- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
180- );
181-
182164 $ uuid = $ this ->getAttribute ('uuid ' );
183165 if (empty ($ uuid )) {
184166 return new JsonResponse (
@@ -204,12 +186,6 @@ public function deleteAction(): ResponseInterface
204186
205187 public function listAction (): ResponseInterface
206188 {
207- $ this ->denyRequest (
208- ! $ this ->isGet (),
209- Message::METHOD_NOT_ALLOWED ,
210- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
211- );
212-
213189 $ result = $ this ->adminService ->getAdmins (
214190 $ this ->getQueryParam ('offset ' , 0 , 'int ' ),
215191 $ this ->getQueryParam ('limit ' , 30 , 'int ' ),
@@ -223,12 +199,6 @@ public function listAction(): ResponseInterface
223199
224200 public function manageAction (): ResponseInterface
225201 {
226- $ this ->denyRequest (
227- ! $ this ->isGet (),
228- Message::METHOD_NOT_ALLOWED ,
229- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
230- );
231-
232202 return new HtmlResponse (
233203 $ this ->template ->render ('admin::list ' )
234204 );
@@ -240,18 +210,11 @@ public function manageAction(): ResponseInterface
240210 */
241211 public function loginAction (): ResponseInterface
242212 {
243- $ this ->denyRequest (
244- ! $ this ->isGet () || ! $ this ->isPost (),
245- Message::METHOD_NOT_ALLOWED ,
246- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
247- );
248-
249213 if ($ this ->authenticationService ->hasIdentity ()) {
250214 return new RedirectResponse ($ this ->router ->generateUri ("dashboard " ));
251215 }
252216
253217 $ form = new LoginForm ();
254-
255218 $ shouldRebind = $ this ->messenger ->getData ('shouldRebind ' ) ?? true ;
256219 if ($ shouldRebind ) {
257220 $ this ->forms ->restoreState ($ form );
@@ -313,26 +276,15 @@ public function loginAction(): ResponseInterface
313276
314277 public function logoutAction (): ResponseInterface
315278 {
316- $ this ->denyRequest (
317- ! $ this ->isGet (),
318- Message::METHOD_NOT_ALLOWED ,
319- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
320- );
321-
322279 $ this ->authenticationService ->clearIdentity ();
280+
323281 return new RedirectResponse (
324282 $ this ->router ->generateUri ('admin ' , ['action ' => 'login ' ])
325283 );
326284 }
327285
328286 public function accountAction (): ResponseInterface
329287 {
330- $ this ->denyRequest (
331- ! $ this ->isGet () || ! $ this ->isPost (),
332- Message::METHOD_NOT_ALLOWED ,
333- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
334- );
335-
336288 $ form = new AccountForm ();
337289 $ changePasswordForm = new ChangePasswordForm ();
338290 $ identity = $ this ->authenticationService ->getIdentity ();
@@ -371,12 +323,6 @@ public function accountAction(): ResponseInterface
371323
372324 public function changePasswordAction (): ResponseInterface
373325 {
374- $ this ->denyRequest (
375- ! $ this ->isGet () || ! $ this ->isPost (),
376- Message::METHOD_NOT_ALLOWED ,
377- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
378- );
379-
380326 $ changePasswordForm = new ChangePasswordForm ();
381327 /** @var AdminIdentity $adminIdentity */
382328 $ adminIdentity = $ this ->authenticationService ->getIdentity ();
@@ -413,12 +359,6 @@ public function changePasswordAction(): ResponseInterface
413359
414360 public function loginsAction (): ResponseInterface
415361 {
416- $ this ->denyRequest (
417- ! $ this ->isGet (),
418- Message::METHOD_NOT_ALLOWED ,
419- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
420- );
421-
422362 return new HtmlResponse (
423363 $ this ->template ->render ('admin::list-logins ' )
424364 );
@@ -429,12 +369,6 @@ public function loginsAction(): ResponseInterface
429369 */
430370 public function listLoginsAction (): ResponseInterface
431371 {
432- $ this ->denyRequest (
433- ! $ this ->isGet (),
434- Message::METHOD_NOT_ALLOWED ,
435- StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED
436- );
437-
438372 $ result = $ this ->adminService ->getAdminLogins (
439373 $ this ->getQueryParam ('offset ' , 0 , 'int ' ),
440374 $ this ->getQueryParam ('limit ' , 30 , 'int ' ),
0 commit comments