Code Duplication    Length = 18-19 lines in 2 locations

src/PlaygroundGame/Controller/Frontend/GameController.php 2 locations

@@ 680-698 (lines=19) @@
677
678
            $logged = $this->forward()->dispatch('playgrounduser_user', array('action' => 'ajaxauthenticate'));
679
680
            if (!$logged) {
681
                $this->flashMessenger()->setNamespace('zfcuser-login-form')->addMessage(
682
                    'Authentication failed. Please try again.'
683
                );
684
                
685
                return $this->redirect()->toUrl(
686
                    $this->frontendUrl()->fromRoute(
687
                        $this->game->getClassType() . '/login',
688
                        array('id' => $this->game->getIdentifier())
689
                    )
690
                );
691
            } else {
692
                return $this->redirect()->toUrl(
693
                    $this->frontendUrl()->fromRoute(
694
                        $this->game->getClassType() . '/index',
695
                        array('id' => $this->game->getIdentifier())
696
                    )
697
                );
698
            }
699
        }
700
        
701
        $form->setAttribute(
@@ 911-928 (lines=18) @@
908
909
            $logged = $this->forward()->dispatch('playgrounduser_user', array('action' => 'ajaxauthenticate'));
910
911
            if ($logged) {
912
                return $this->redirect()->toUrl(
913
                    $this->frontendUrl()->fromRoute(
914
                        $this->game->getClassType(),
915
                        array('id' => $this->game->getIdentifier())
916
                    )
917
                );
918
            } else {
919
                $this->flashMessenger()->setNamespace('zfcuser-login-form')->addMessage(
920
                    'Authentication failed. Please try again.'
921
                );
922
                return $this->redirect()->toUrl(
923
                    $this->frontendUrl()->fromRoute(
924
                        $this->game->getClassType() . '/login',
925
                        array('id' => $this->game->getIdentifier())
926
                    )
927
                );
928
            }
929
        }
930
931
        $redirect = $this->frontendUrl()->fromRoute(