Code Duplication    Length = 17-17 lines in 2 locations

src/Observer/Controller/Admin/Postdispatch.php 1 location

@@ 92-108 (lines=17) @@
89
     *
90
     * @return void
91
     */
92
    public function execute(Observer $observer)
93
    {
94
        if ($this->isTwoFactorEnabled() === false) {
95
            return;
96
        }
97
98
        if ($this->shouldTheUserBeRedirected() === false) {
99
            return;
100
        }
101
102
        if ($this->areWeOnANonRedirectingPage() === true) {
103
            return;
104
        }
105
106
        $controller = $observer->getEvent()->getData('controller_action');
107
        $this->redirectToAuthenticationPage($controller);
108
    }
109
110
    private function isTwoFactorEnabled()
111
    {

src/Observer/Controller/Frontend/Postdispatch.php 1 location

@@ 108-124 (lines=17) @@
105
     *
106
     * @return void
107
     */
108
    public function execute(Observer $observer)
109
    {
110
        if ($this->isTwoFactorEnabled() === false) {
111
            return;
112
        }
113
114
        if ($this->shouldTheCustomerBeRedirected() === false) {
115
            return;
116
        }
117
118
        if ($this->hasTwoFactorBeenChecked() === true) {
119
            return;
120
        }
121
122
        $controller = $observer->getEvent()->getData('controller_action');
123
        $this->redirectToTwoFactorCheck($controller);
124
    }
125
126
    private function isTwoFactorEnabled()
127
    {