Standard\Controllers\AuthController::processResetPassAction PHP Method

processResetPassAction() public method

    public function processResetPassAction()
    {
        /** @var UserModel $user */
        $user = Gatekeeper::findUserByEmail($_SESSION['user']);
        if (!$user) {
            $this->flasher->error('Password reset session expired');
            unset($_SESSION['user']);
            $this->redirect('/');
        }
        if ($_POST['password'] == $_POST['password_confirm']) {
            $user->password = $_POST['password'];
            if ($user->save()) {
                $this->flasher->success('Successfully changed password!');
            } else {
                $this->flasher->error('Could not update password :(');
            }
            $this->redirect('/');
        }
    }