Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions codex-vscode/src/services/oauth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class OAuthService implements IOAuthService {
*/
public async authenticate(oAuthPath: OAuthPath): Promise<UserInfo | ErrorResponse> {
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);
Expand All @@ -26,7 +26,7 @@ export class OAuthService implements IOAuthService {
// before completing it.
if (!OAuthService.codeExchangePromise) {
OAuthService.codeExchangePromise = promiseFromEvent(
ee.event,
eventEmitter.event,
this.postAuthorization()
);
}
Expand All @@ -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<vscode.Uri, UserInfo> =
() =>
Expand Down