Code Duplication    Length = 3-3 lines in 2 locations

src/Controller/UsersController.php 2 locations

@@ 165-167 (lines=3) @@
162
                        $this->eventManager()->dispatch($user);
163
164
                        $url = $this->Auth->redirectUrl();
165
                        if (substr($this->Auth->redirectUrl(), -5) == 'login') {
166
                            $url = ['controller' => 'pages', 'action' => 'home'];
167
                        }
168
169
                        return $this->redirect($url);
170
                    }
@@ 251-253 (lines=3) @@
248
                            $this->Flash->success(__("Your account has been created successfully !"));
249
250
                            $url = $this->Auth->redirectUrl();
251
                            if (substr($this->Auth->redirectUrl(), -5) == 'login') {
252
                                $url = ['controller' => 'pages', 'action' => 'home'];
253
                            }
254
255
                            return $this->redirect($url);
256
                        }