backupApp.controller('ResetPasswordController', function($scope, authenticationApiConnector, DialogService, gettextCatalog, SystemInfo) {

    const FORGET_PASSWORD_URL = './forget-password.cgi';

    $scope.resetPassword = () => {

        $scope.processing = true;
        authenticationApiConnector.post(FORGET_PASSWORD_URL, {'reset-password-code': $scope.resetCode})
            .then( _ => window.location = './' )
            .catch(_ => {
                DialogService.dialog(gettextCatalog.getString('Error'),
                    gettextCatalog.getString(_.statusText)
                )
                $scope.processing = false;
            });
    }

});
