Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion codex-vscode/src/commands/auth/oAuth.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -60,3 +60,4 @@ export default class AuthorizeOAuthCommand extends BaseAuthCommand {
}
}
}

1 change: 1 addition & 0 deletions codex-vscode/src/helpers/handlers/OAuthUrl.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ export class OAuthUrlHandler implements IURLHandler, Singleton {
this._uriEventEmitter.fire(uri);
}
}

3 changes: 2 additions & 1 deletion codex-vscode/src/services/oauth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>} the jwt of the user we are authenticating through GitHub
*/
public async authenticate(oAuthPath: OAuthPath): Promise<UserInfo | ErrorResponse> {
public async oAuthenticate(oAuthPath: OAuthPath): Promise<UserInfo | ErrorResponse> {
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}`);
Expand Down Expand Up @@ -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