diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 9502e9b..50f199b 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'; import { UDSApiService } from '../../uds-api.service'; import { Authenticator } from '../../types/config'; +declare var django: any; + @Component({ selector: 'uds-login', templateUrl: './login.component.html', @@ -32,6 +34,11 @@ export class LoginComponent implements OnInit { if (this.auths.length > 0) { this.auth.value = this.auths[0].id; } + + if (this.api.errors.length > 0) { + this.api.gui.alert(django.gettext('Errors found'), '
' + this.api.errors.join('
') + '
' ); + } + } changeAuth(auth) { diff --git a/src/app/uds-api.service.ts b/src/app/uds-api.service.ts index e0287b2..e983bbe 100644 --- a/src/app/uds-api.service.ts +++ b/src/app/uds-api.service.ts @@ -47,6 +47,17 @@ export class UDSApiService implements UDSApiServiceType { return udsData.actors; } + /** + * Actor errors. Empty array it no errors. + * + * @readonly + * @type {string[]} + * @memberof UDSApiService + */ + get errors(): string[] { + return udsData.errors; + } + /* Client enabler */ enabler(serviceId: string, transportId: string) { const enabler = this.config.urls.enabler.replace('param1', serviceId).replace('param2', transportId);