diff --git a/codex-vscode/src/services/oauth.service.ts b/codex-vscode/src/services/oauth.service.ts index a1e1e68a..8c8f64db 100644 --- a/codex-vscode/src/services/oauth.service.ts +++ b/codex-vscode/src/services/oauth.service.ts @@ -17,7 +17,7 @@ export class OAuthService implements IOAuthService { */ public async authenticate(oAuthPath: OAuthPath): Promise { const oAuthPlatform: OAuthPlatform = oAuthPath === OAuthPath.google ? OAuthPlatform.google : OAuthPlatform.github; - const ee = OAuthUrlHandler.getInstance().getEventEmitter(); + const eventEmitter = OAuthUrlHandler.getInstance().getEventEmitter(); const uri = vscode.Uri.parse(`${process.env.API_URL}${oAuthPath}`); await vscode.env.openExternal(uri); @@ -26,7 +26,7 @@ export class OAuthService implements IOAuthService { // before completing it. if (!OAuthService.codeExchangePromise) { OAuthService.codeExchangePromise = promiseFromEvent( - ee.event, + eventEmitter.event, this.postAuthorization() ); } @@ -46,6 +46,7 @@ export class OAuthService implements IOAuthService { ]); } + // postAuthorization returns a function that is called from the promiseFromEvent function when the event is fired private postAuthorization: () => PromiseAdapter = () =>