diff --git a/codex-vscode/src/commands/auth/oAuth.command.ts b/codex-vscode/src/commands/auth/oAuth.command.ts index 8a71cef8..8534d628 100644 --- a/codex-vscode/src/commands/auth/oAuth.command.ts +++ b/codex-vscode/src/commands/auth/oAuth.command.ts @@ -23,7 +23,7 @@ export default class AuthorizeOAuthCommand extends BaseAuthCommand { } async execute() { try { - const userInfo: UserInfo = (await this.oAuthService.authenticate(this.oAuthPath)) as UserInfo; + const userInfo: UserInfo = (await this.oAuthService.oAuthenticate(this.oAuthPath)) as UserInfo; if (userInfo.user && userInfo.jwt) { const { user, jwt } = userInfo; await this.authenticate(user, jwt); @@ -60,3 +60,4 @@ export default class AuthorizeOAuthCommand extends BaseAuthCommand { } } } + diff --git a/codex-vscode/src/helpers/handlers/OAuthUrl.handler.ts b/codex-vscode/src/helpers/handlers/OAuthUrl.handler.ts index f6c38ea5..77ca8dea 100644 --- a/codex-vscode/src/helpers/handlers/OAuthUrl.handler.ts +++ b/codex-vscode/src/helpers/handlers/OAuthUrl.handler.ts @@ -38,3 +38,4 @@ export class OAuthUrlHandler implements IURLHandler, Singleton { this._uriEventEmitter.fire(uri); } } + diff --git a/codex-vscode/src/services/oauth.service.ts b/codex-vscode/src/services/oauth.service.ts index a1e1e68a..c6d88feb 100644 --- a/codex-vscode/src/services/oauth.service.ts +++ b/codex-vscode/src/services/oauth.service.ts @@ -15,7 +15,7 @@ export class OAuthService implements IOAuthService { * Initiates the flow of opening a browser window to allow the user to sign in to GitHub and authenticate with Codex * @returns {Promise} the jwt of the user we are authenticating through GitHub */ - public async authenticate(oAuthPath: OAuthPath): Promise { + public async oAuthenticate(oAuthPath: OAuthPath): Promise { const oAuthPlatform: OAuthPlatform = oAuthPath === OAuthPath.google ? OAuthPlatform.google : OAuthPlatform.github; const ee = OAuthUrlHandler.getInstance().getEventEmitter(); const uri = vscode.Uri.parse(`${process.env.API_URL}${oAuthPath}`); @@ -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 = () =>