diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts index 804cf5dc32..9b24a7b999 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts @@ -1,5 +1,10 @@ -import { ApplicationConfiguration, AuthService, ConfigStateService } from '@abp/ng.core'; -import { Component, OnInit } from '@angular/core'; +import { + ApplicationConfiguration, + AuthService, + ConfigStateService, + EnvironmentService, +} from '@abp/ng.core'; +import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; @@ -8,7 +13,7 @@ import { Observable } from 'rxjs'; // tslint:disable-next-line: component-max-inline-declarations template: ` - {{ + {{ 'AbpAccount::Login' | abpLocalization }} @@ -36,7 +41,7 @@ import { Observable } from 'rxjs'; aria-labelledby="dropdownMenuLink" [class.d-block]="smallScreen && currentUserDropdown.isOpen()" > - {{ 'AbpAccount::ManageYourProfile' | abpLocalization }} `, }) -export class CurrentUserComponent implements OnInit { +export class CurrentUserComponent { currentUser$: Observable = this.configState.getOne$( 'currentUser', ); @@ -55,13 +60,22 @@ export class CurrentUserComponent implements OnInit { return window.innerWidth < 992; } + get manageProfileUrl() { + return `${this.environment.getEnvironment().oAuthConfig.issuer}/Account/Manage?returnUrl=${ + window.location.href + }`; + } + constructor( private authService: AuthService, private router: Router, private configState: ConfigStateService, + private environment: EnvironmentService, ) {} - ngOnInit() {} + initLogin() { + this.authService.initLogin(); + } logout() { this.authService.logout().subscribe(() => {