plugins: migrate usage of deprecated IdentityApi methods
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -25,8 +25,8 @@ import { UrlPatternDiscovery } from '@backstage/core-app-api';
|
||||
const server = setupServer();
|
||||
|
||||
const identityApi = {
|
||||
async getIdToken() {
|
||||
return Promise.resolve('fake-id-token');
|
||||
async getCredentials() {
|
||||
return { token: 'fake-id-token' };
|
||||
},
|
||||
} as IdentityApi;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export class FossaClient implements FossaApi {
|
||||
query: Record<string, any>,
|
||||
): Promise<T> {
|
||||
const apiUrl = `${await this.discoveryApi.getBaseUrl('proxy')}/fossa`;
|
||||
const idToken = await this.identityApi.getIdToken();
|
||||
const { token: idToken } = await this.identityApi.getCredentials();
|
||||
const response = await fetch(
|
||||
`${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user