Code Duplication    Length = 4-4 lines in 2 locations

src/Controllers/UserController.php 2 locations

@@ 77-80 (lines=4) @@
74
            return new RedirectResponse($this->config->baseUrl() . '/login?name=' . $name);
75
        }
76
        $password = $this->getBodyParam($request, 'password');
77
        if ($password !== $this->getBodyParam($request, 'password-confirmation')) {
78
            $template->alert('warning', 'Your passwords did not match.', true);
79
            return new RedirectResponse($this->config->baseUrl() . "/register?name=$name&email=$email");
80
        }
81
        $user = new User($this->db);
82
        $user->register($name, $email, $password);
83
        $template->alert('success', 'Thank you for registering.', true);
@@ 148-151 (lines=4) @@
145
        // Then see if the token is valid.
146
        $user = new User($this->db);
147
        $user->load($args['userid']);
148
        if (!$user->checkReminderToken($args['token'])) {
149
            $template->alert('warning', 'That reminder token has expired. Please try again.', true);
150
            return new RedirectResponse($this->config->baseUrl() . "/remind");
151
        }
152
        // Finally change the password. This will delete the token as well.
153
        $user->changePassword($password);
154
        $template->alert('success', 'Your password has been changed. Please log in.', true);