[CORD-989] Login errors

Change-Id: I781f3535110664d4b1de2659f6995102949ffb8c
diff --git a/src/app/datasources/rest/auth.rest.ts b/src/app/datasources/rest/auth.rest.ts
index edc2a65..81c4f7d 100644
--- a/src/app/datasources/rest/auth.rest.ts
+++ b/src/app/datasources/rest/auth.rest.ts
@@ -7,8 +7,6 @@
 
 export interface IAuthResponseData extends IHttpPromiseCallbackArg<any> {
   data: {
-    // user: string;
-    // xoscsrftoken: string;
     sessionid: string;
   };
 }
@@ -39,10 +37,10 @@
     const d = this.$q.defer();
     this.$http.post(`${this.AppConfig.apiEndpoint}/utility/login`, data)
       .then((res: IAuthResponseData) => {
-        // this.$cookies.put('xoscsrftoken', res.data.xoscsrftoken, {path: '/'});
+        if (res.status >= 400) {
+          return d.reject(res.data);
+        }
         this.$cookies.put('sessionid', res.data.sessionid, {path: '/'});
-        // this.$cookies.put('xosuser', res.data.user, {path: '/'});
-        // res.data.user = JSON.parse(res.data.user);
         d.resolve(res.data);
       })
       .catch(e => {