Skip to content

Commit 9e41ad6

Browse files
abeesharuniverse
andauthored
Exposed a few methods to derived class to support other client (#286)
Co-authored-by: Arun George <11051042+aruniverse@users.noreply.github.com>
1 parent 42f04b3 commit 9e41ad6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Exposed a few methods to the derived class to support other clients",
4+
"packageName": "@itwin/electron-authorization",
5+
"email": "3654177+abeesh@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/electron/src/main/Client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export class ElectronMainAuthorization implements AuthorizationClient {
281281
return this._accessToken;
282282
}
283283

284-
private setAccessToken(token: AccessToken) {
284+
protected setAccessToken(token: AccessToken) {
285285
if (token === this._accessToken)
286286
return;
287287

@@ -301,7 +301,7 @@ export class ElectronMainAuthorization implements AuthorizationClient {
301301
/** Loads the access token from the store, and refreshes it if necessary and possible
302302
* @return AccessToken if it's possible to get a valid access token, and undefined otherwise.
303303
*/
304-
private async loadAccessToken(): Promise<AccessToken> {
304+
protected async loadAccessToken(): Promise<AccessToken> {
305305
const refreshToken = await this._refreshTokenStore.load(this._scopes);
306306

307307
if (!refreshToken)
@@ -522,7 +522,7 @@ export class ElectronMainAuthorization implements AuthorizationClient {
522522
await electron.shell.openExternal(this._configuration.endSessionEndpoint);
523523
}
524524

525-
private async processTokenResponse(
525+
protected async processTokenResponse(
526526
tokenResponse: TokenResponse,
527527
): Promise<AccessToken> {
528528
this._refreshToken = tokenResponse.refreshToken;
@@ -540,7 +540,7 @@ export class ElectronMainAuthorization implements AuthorizationClient {
540540
return bearerToken;
541541
}
542542

543-
private async clearTokenCache() {
543+
protected async clearTokenCache() {
544544
this._refreshToken = undefined;
545545
this._expiresAt = undefined;
546546

0 commit comments

Comments
 (0)