diff --git a/static/src/app/login/login.component.ts b/static/src/app/login/login.component.ts index b5e48e6..35c93a9 100644 --- a/static/src/app/login/login.component.ts +++ b/static/src/app/login/login.component.ts @@ -38,7 +38,8 @@ export class LoginComponent implements OnInit { this.router.navigate([this.returnUrl]); }, error => { - this.snackBarService.showError(error._body, 15000); + // TODO: return i18n key from backend to use translate error method + this.snackBarService.showUntranslatedError(error.error, 15000); this.loading = false; }); } diff --git a/static/src/app/services/user-interface/snack-bar/snack-bar.service.ts b/static/src/app/services/user-interface/snack-bar/snack-bar.service.ts index f4c7842..2cd5565 100644 --- a/static/src/app/services/user-interface/snack-bar/snack-bar.service.ts +++ b/static/src/app/services/user-interface/snack-bar/snack-bar.service.ts @@ -42,4 +42,8 @@ export class SnackBarService { }); }); } + + showUntranslatedError(message: string, duration?: number) { + return this.show(message, 'OK', duration, ['custom-snack-bar', 'label-danger']); + } }