mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-5139] User name style and Discovery service initialization fix (#7010)
* [AAE-5139] User name style fix and Discovery serice fixed * * fixed unit test * * fixed test and us latest js-api events * * tests fixed * * update js api * * fixed test and lint
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError, Observer, ReplaySubject, Subject } from 'rxjs';
|
||||
import { Observable, from, throwError, Observer, ReplaySubject } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
@@ -38,12 +38,6 @@ export class AuthenticationService {
|
||||
private redirectUrl: RedirectionModel = null;
|
||||
|
||||
private bearerExcludedUrls: string[] = ['auth/realms', 'resources/', 'assets/'];
|
||||
|
||||
/**
|
||||
* Emits oAuth token exchange event
|
||||
*/
|
||||
onTokenExchange: Subject<string> = new Subject<string>();
|
||||
|
||||
/**
|
||||
* Emits Basic auth login event
|
||||
*/
|
||||
@@ -60,14 +54,8 @@ export class AuthenticationService {
|
||||
private alfrescoApi: AlfrescoApiService,
|
||||
private cookie: CookieService,
|
||||
private logService: LogService) {
|
||||
this.listenForOauthTokenExchange();
|
||||
}
|
||||
|
||||
private listenForOauthTokenExchange() {
|
||||
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
||||
this.alfrescoApi.getInstance().oauth2Auth?.on('token_issued', () => {
|
||||
this.onTokenExchange.next(this.alfrescoApi.getInstance().oauth2Auth.token);
|
||||
});
|
||||
this.alfrescoApi.getInstance().reply('logged-in', () => this.onLogin.next());
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user