feat: support google cloud login in client (#1822)

Co-authored-by: Himself65 <himself65@outlook.com>
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
This commit is contained in:
Horus
2023-04-12 02:42:36 +08:00
committed by GitHub
parent 024c469a2c
commit c0669359ed
17 changed files with 252 additions and 42 deletions

View File

@@ -21,7 +21,6 @@ import { isMacOS } from '../../utils';
*
* @see https://github.com/cawa-93/dts-for-context-bridge
*/
contextBridge.exposeInMainWorld('apis', {
workspaceSync: (id: string) => ipcRenderer.invoke('octo:workspace-sync', id),
// ui
@@ -30,6 +29,18 @@ contextBridge.exposeInMainWorld('apis', {
onSidebarVisibilityChange: (visible: boolean) =>
ipcRenderer.invoke('ui:sidebar-visibility-change', visible),
/**
* Try sign in using Google and return a Google IDToken
*/
googleSignIn: (): Promise<string> => ipcRenderer.invoke('ui:google-sign-in'),
/**
* Secret backdoor to update environment variables in main process
*/
updateEnv: (env: string, value: string) => {
ipcRenderer.invoke('main:env-update', env, value);
},
});
contextBridge.exposeInMainWorld('appInfo', {