This commit is contained in:
paisley
2026-03-08 13:25:57 +08:00
5 changed files with 16 additions and 16 deletions

View File

@@ -1554,18 +1554,18 @@ function registerDeviceOAuthHandlers(mainWindow: BrowserWindow): void {
region?: 'global' | 'cn', region?: 'global' | 'cn',
options?: { accountId?: string; label?: string }, options?: { accountId?: string; label?: string },
) => { ) => {
try { try {
logger.info(`provider:requestOAuth for ${provider}`); logger.info(`provider:requestOAuth for ${provider}`);
if (provider === 'google') { if (provider === 'google') {
await browserOAuthManager.startFlow(provider, options); await browserOAuthManager.startFlow(provider, options);
} else { } else {
await deviceOAuthManager.startFlow(provider, region, options); await deviceOAuthManager.startFlow(provider, region, options);
}
return { success: true };
} catch (error) {
logger.error('provider:requestOAuth failed', error);
return { success: false, error: String(error) };
} }
return { success: true };
} catch (error) {
logger.error('provider:requestOAuth failed', error);
return { success: false, error: String(error) };
}
}, },
); );