diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts new file mode 100644 index 000000000..c1d33b938 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit } from '@angular/core'; + +import { AuthService } from '~/app/shared/api/auth.service'; +import { Icons } from '~/app/shared/enum/icons.enum'; +import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; + +@Component({ + selector: 'cd-identity', + templateUrl: './identity.component.html', + styleUrls: ['./identity.component.scss'] +}) +export class IdentityComponent implements OnInit { + sso: boolean; + username: string; + icons = Icons; + + constructor(private authStorageService: AuthStorageService, private authService: AuthService) {} + + ngOnInit() { + this.username = this.authStorageService.getUsername(); + this.sso = this.authStorageService.isSSO(); + } + + logout() { + this.authService.logout(); + } +} |