mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[AAE-12501] Replace oauth2Auth with authentication service to get the token
This commit is contained in:
@@ -22,7 +22,7 @@ import { WebSocketLink } from '@apollo/client/link/ws';
|
||||
import { onError } from '@apollo/client/link/error';
|
||||
import { getMainDefinition } from '@apollo/client/utilities';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AppConfigService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AppConfigService, AlfrescoApiService, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { BaseCloudService } from './base-cloud.service';
|
||||
|
||||
@Injectable({
|
||||
@@ -35,7 +35,8 @@ export class NotificationCloudService extends BaseCloudService {
|
||||
constructor(apiService: AlfrescoApiService,
|
||||
appConfigService: AppConfigService,
|
||||
public apollo: Apollo,
|
||||
private http: HttpLink) {
|
||||
private http: HttpLink,
|
||||
private authService: AuthenticationService) {
|
||||
super(apiService, appConfigService);
|
||||
}
|
||||
|
||||
@@ -62,7 +63,7 @@ export class NotificationCloudService extends BaseCloudService {
|
||||
connectionParams: {
|
||||
kaInterval: 2000,
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'X-Authorization': 'Bearer ' + this.apiService.getInstance().oauth2Auth.token
|
||||
'X-Authorization': 'Bearer ' + this.authService.getToken()
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -86,7 +87,7 @@ export class NotificationCloudService extends BaseCloudService {
|
||||
headers: {
|
||||
...oldHeaders,
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'X-Authorization': 'Bearer ' + this.apiService.getInstance().oauth2Auth.token
|
||||
'X-Authorization': 'Bearer ' + this.authService.getToken()
|
||||
}
|
||||
});
|
||||
forward(operation);
|
||||
|
||||
Reference in New Issue
Block a user