Add OAuth login support and streamline authentication flows

- Introduced `oauthLogin` method in `electron/preload.ts` and backend IPC handlers for OAuth via `BrowserWindow`.
- Replaced web-based OAuth redirection with Electron-specific implementation for Google, Facebook, and Apple.
- Refactored `SocialForm.tsx` to handle OAuth login success and token management via Electron.
- Updated `User`, `QuillSense`, and context methods to include `quill-trial` subscriptions and extended login logic.
- Cleaned up code, removed unused imports, and improved error handling for authentication scenarios.
This commit is contained in:
natreex
2026-01-08 11:03:19 -05:00
parent 7378d3c1f9
commit 060693f152
8 changed files with 206 additions and 62 deletions

View File

@@ -38,6 +38,10 @@ contextBridge.exposeInMainWorld('electron', {
// Open external links (browser/native app)
openExternal: (url: string) => ipcRenderer.invoke('open-external', url),
// OAuth login via BrowserWindow
oauthLogin: (provider: 'google' | 'facebook' | 'apple', baseUrl: string) =>
ipcRenderer.invoke('oauth-login', { provider, baseUrl }),
// Offline mode management
offlinePinSet: (pin: string) => ipcRenderer.invoke('offline:pin:set', { pin }),
offlinePinVerify: (pin: string) => ipcRenderer.invoke('offline:pin:verify', { pin }),