diff --git a/ui/src/app/account/service/account.service.ts b/ui/src/app/account/service/account.service.ts index d04544717..d8092d237 100644 --- a/ui/src/app/account/service/account.service.ts +++ b/ui/src/app/account/service/account.service.ts @@ -137,10 +137,6 @@ export class AccountService { return this.accountData.value !== undefined } - getAuthenticationState(): Observable { - return this.accountData.asObservable() - } - getImageUrl(): string | null { return this.isIdentityResolved() ? this.accountData.value!.imageUrl : null } diff --git a/ui/src/app/layout/navbar/navbar.component.spec.ts b/ui/src/app/layout/navbar/navbar.component.spec.ts index 7ebd3e9b7..a4301733d 100644 --- a/ui/src/app/layout/navbar/navbar.component.spec.ts +++ b/ui/src/app/layout/navbar/navbar.component.spec.ts @@ -24,7 +24,6 @@ describe('NavbarComponent', () => { 'getAccountData', 'isAuthenticated', 'hasAnyAuthority', - 'getAuthenticationState', 'isLoggedAs', 'isOrganizationOwner', 'getImageUrl', @@ -60,7 +59,7 @@ describe('NavbarComponent', () => { accountService.isOrganizationOwner.and.returnValue(false) accountService.getImageUrl.and.returnValue(null) accountService.getSalesforceId.and.returnValue('sfid') - accountService.getAuthenticationState.and.returnValue( + accountService.getAccountData.and.returnValue( of({ activated: true, authorities: ['ROLE_USER'], @@ -105,7 +104,7 @@ describe('NavbarComponent', () => { accountService.isOrganizationOwner.and.returnValue(false) accountService.getImageUrl.and.returnValue(null) accountService.getSalesforceId.and.returnValue('sfid') - accountService.getAuthenticationState.and.returnValue( + accountService.getAccountData.and.returnValue( of({ activated: true, authorities: ['ROLE_USER', 'ROLE_CONSORTIUM_LEAD'], @@ -143,7 +142,7 @@ describe('NavbarComponent', () => { accountService.isOrganizationOwner.and.returnValue(false) accountService.getImageUrl.and.returnValue(null) accountService.getSalesforceId.and.returnValue('sfid') - accountService.getAuthenticationState.and.returnValue( + accountService.getAccountData.and.returnValue( of({ activated: true, authorities: ['ROLE_USER', 'ASSERTION_SERVICE_ENABLED'], diff --git a/ui/src/app/layout/navbar/navbar.component.ts b/ui/src/app/layout/navbar/navbar.component.ts index 3d62abc2a..18150c009 100644 --- a/ui/src/app/layout/navbar/navbar.component.ts +++ b/ui/src/app/layout/navbar/navbar.component.ts @@ -61,10 +61,9 @@ export class NavbarComponent implements OnInit { } ngOnInit() { - this.accountService.getAuthenticationState().subscribe(() => { + this.accountService.getAccountData().subscribe(() => { if (!this.memberCallDone && this.isAuthenticated() && this.hasRoleUser()) { this.memberCallDone = true - const salesforceId = this.accountService.getSalesforceId() if (salesforceId) { this.memberService.find(salesforceId).subscribe({ diff --git a/ui/src/app/shared/directive/has-any-authority.directive.ts b/ui/src/app/shared/directive/has-any-authority.directive.ts index 279e6e92a..08e9971d5 100644 --- a/ui/src/app/shared/directive/has-any-authority.directive.ts +++ b/ui/src/app/shared/directive/has-any-authority.directive.ts @@ -29,7 +29,7 @@ export class HasAnyAuthorityDirective { this.authorities = typeof value === 'string' ? [value] : value this.updateView() // Get notified each time authentication state changes. - this.accountService.getAuthenticationState().subscribe((identity) => this.updateView()) + this.accountService.getAccountData().subscribe((identity) => this.updateView()) } private updateView(): void {