Verify the old Password

Call a special login function, that does not use the current
session and ignores the intercept which would log out the
user on a bad old password.
This special login function, testPassword(), calls /login with
the old password, a success verifies the password is correct.

Tested: Changed the user password on a Witherspoon and
verified an incorrect old password does not change the password.
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Change-Id: I65f6a6aa6dbc5d849e962b6c24a09e3ac0f6cf58
diff --git a/app/common/services/apiInterceptor.js b/app/common/services/apiInterceptor.js
index 8bbb6f4..304d723 100644
--- a/app/common/services/apiInterceptor.js
+++ b/app/common/services/apiInterceptor.js
@@ -43,16 +43,19 @@
                     return response;
                 },
                 'responseError': function(rejection){
-                    // If unauthorized, log out
-                    if (rejection.status == 401){
-                        if (dataService.path != '/login'){
-                            $rootScope.$emit('timedout-user', {});
+                    if (dataService.ignoreHttpError === false)
+                    {
+                        // If unauthorized, log out
+                        if (rejection.status == 401){
+                            if (dataService.path != '/login'){
+                                $rootScope.$emit('timedout-user', {});
+                            }
+                        } else if (rejection.status == -1){
+                            dataService.server_unreachable = true;
                         }
-                    } else if (rejection.status == -1){
-                        dataService.server_unreachable = true;
-                    }
 
-                    dataService.loading = false;
+                        dataService.loading = false;
+                    }
                     return $q.reject(rejection);
                 }
             };