Skip to content

Commit

Permalink
solved lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
franklbh committed Nov 20, 2024
1 parent 6ad91fc commit 9984b46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions packages/oidc-signin-tool/src/certa/certaBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import * as fs from "fs";
import * as path from "path";
import type { AccessToken } from "@itwin/core-bentley";
import { registerBackendCallback } from "@itwin/certa/lib/utils/CallbackUtils";
import { ServiceAuthorizationClient, ServiceAuthorizationClientConfiguration } from "@itwin/service-authorization";
import type { ServiceAuthorizationClientConfiguration } from "@itwin/service-authorization";
import { ServiceAuthorizationClient } from "@itwin/service-authorization";
import type { TestBrowserAuthorizationClientConfiguration, TestUserCredentials } from "../TestUsers";
import { TestUtility } from "../TestUtility";
import { getTokenCallbackName, getServiceAuthTokenCallbackName } from "./certaCommon";
import { getServiceAuthTokenCallbackName, getTokenCallbackName } from "./certaCommon";

// A backend to use within Certa's `backendInitModule` to setup OIDC sign-in.

Expand Down Expand Up @@ -57,7 +58,6 @@ async function signin(user: TestUserCredentials, oidcConfig?: TestBrowserAuthori
if (undefined === token)
throw new Error("Failed to get access token");


return token;
}

Expand All @@ -78,7 +78,6 @@ registerBackendCallback(
},
);


registerBackendCallback(getServiceAuthTokenCallbackName, async (oidcConfig: ServiceAuthorizationClientConfiguration): Promise<string> => {
return signinWithServiceAuthClient(oidcConfig);
});
});
6 changes: 4 additions & 2 deletions packages/oidc-signin-tool/src/certa/certaCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export async function getAccessTokenFromBackend(user: TestUserCredentials, oidcC
return accessToken;
}


/**
* Retrieves a service authorization token from the backend.
*/
export async function getServiceAuthTokenFromBackend(oidcConfig: ServiceAuthorizationClientConfiguration): Promise<string> {
const accessToken = await executeBackendCallback(getServiceAuthTokenCallbackName, oidcConfig);
return accessToken;
}
}

0 comments on commit 9984b46

Please sign in to comment.