feat(provider): add OpenAI Codex browser OAuth flow (#398)
Co-authored-by: zuolingxuan <zuolingxuan@bytedance.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
880995af19
commit
31e80f256b
@@ -283,6 +283,10 @@ async function initialize(): Promise<void> {
|
||||
hostEventBus.emit('oauth:start', payload);
|
||||
});
|
||||
|
||||
browserOAuthManager.on('oauth:code', (payload) => {
|
||||
hostEventBus.emit('oauth:code', payload);
|
||||
});
|
||||
|
||||
browserOAuthManager.on('oauth:success', (payload) => {
|
||||
hostEventBus.emit('oauth:success', { ...payload, success: true });
|
||||
});
|
||||
|
||||
@@ -1758,7 +1758,7 @@ function registerDeviceOAuthHandlers(mainWindow: BrowserWindow): void {
|
||||
) => {
|
||||
try {
|
||||
logger.info(`provider:requestOAuth for ${provider}`);
|
||||
if (provider === 'google') {
|
||||
if (provider === 'google' || provider === 'openai') {
|
||||
await browserOAuthManager.startFlow(provider, options);
|
||||
} else {
|
||||
await deviceOAuthManager.startFlow(provider, region, options);
|
||||
|
||||
Reference in New Issue
Block a user