My code looks like this:

```
  $scope.login = function (userName, password, rememberMe) {
        authentication.authenticating = true;
        var config = {
            method: 'POST',
            url: '/api/Account/Login',
            data: { 'userName': userName, 'password': password, 'rememberMe': rememberMe }

        };
        $http(config)
            .success(function (data) {
                authentication.authenticating = false;
                authentication.isAuthenticated = true;
                $scope.template = $scope.templates[1];
                $scope.userName = userName;
            })
            .error(function (data) {
                $scope.loginError = "Invalid username/password combination";
                authentication.authenticating = false;
            });
    };

```

Is there a way I can move the authentication.authenticating = false; into some code block that will always execute after an error or success ?