diff --git a/smp-angular/src/app/login/login.component.ts b/smp-angular/src/app/login/login.component.ts index 5a5ce8703232adc20767213aab17e2dedd3bb113..4abeb0c61189343465e4290855659aacab52c86e 100644 --- a/smp-angular/src/app/login/login.component.ts +++ b/smp-angular/src/app/login/login.component.ts @@ -40,8 +40,6 @@ export class LoginComponent implements OnInit, OnDestroy { loading = false; returnUrl: string; sub: Subscription; - localeSub: Subscription; - constructor(private route: ActivatedRoute, private router: Router, @@ -91,8 +89,6 @@ export class LoginComponent implements OnInit, OnDestroy { } }); - this.localeSub = this.securityEventService.onLoginSuccessEvent().subscribe(user => user && this.translateService.use(user.smpLocale)); - this.securityEventService.onLoginErrorEvent().subscribe( async error => { let message; @@ -176,7 +172,6 @@ export class LoginComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.sub.unsubscribe(); - this.localeSub.unsubscribe(); } isUserAuthSSOEnabled(): boolean { diff --git a/smp-angular/src/app/security/security.service.ts b/smp-angular/src/app/security/security.service.ts index b1e82dc40b2d2ce166d737040c49a1478adf3cd5..c77e2e7559af3cbfdb7ff934c19f70cb2db33206 100644 --- a/smp-angular/src/app/security/security.service.ts +++ b/smp-angular/src/app/security/security.service.ts @@ -50,6 +50,7 @@ export class SecurityService { .subscribe({ next: (response: User) => { this.updateUserDetails(response); + this.translateService.use(response?.smpLocale); this.securityEventService.notifyLoginSuccessEvent(response); }, error: (error: any) => {