feat
This commit is contained in:
@@ -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) };
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user