[CORD-989] Login errors
Change-Id: I781f3535110664d4b1de2659f6995102949ffb8c
diff --git a/src/app/core/login/login.ts b/src/app/core/login/login.ts
index 183980a..558fe37 100644
--- a/src/app/core/login/login.ts
+++ b/src/app/core/login/login.ts
@@ -8,7 +8,8 @@
static $inject = ['$log', 'AuthService', '$state', 'XosModelDiscoverer', 'StyleConfig'];
public loginStyle: any;
public img: string;
-
+ public showErrorMsg: boolean = false;
+ public errorMsg: string;
constructor(
private $log: ng.ILogService,
private authService: AuthService,
@@ -34,6 +35,7 @@
password: password
})
.then(res => {
+ this.showErrorMsg = false;
// after login set up models
return this.XosModelDiscoverer.discover();
})
@@ -41,7 +43,9 @@
this.$state.go('xos.dashboard');
})
.catch(e => {
- this.$log.error(e);
+ this.$log.error(`[XosLogin] Error during login.`);
+ this.errorMsg = `Something went wrong, please try again.`;
+ this.showErrorMsg = true;
});
}