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:
8
electron.d.ts
vendored
8
electron.d.ts
vendored
@@ -40,6 +40,14 @@ export interface IElectronAPI {
|
||||
// Open external links (browser/native app)
|
||||
openExternal: (url: string) => Promise<void>;
|
||||
|
||||
// OAuth login via BrowserWindow
|
||||
oauthLogin: (provider: 'google' | 'facebook' | 'apple', baseUrl: string) => Promise<{
|
||||
success: boolean;
|
||||
code?: string;
|
||||
state?: string;
|
||||
error?: string;
|
||||
}>;
|
||||
|
||||
// Offline mode management
|
||||
offlinePinSet: (pin: string) => Promise<{ success: boolean; error?: string }>;
|
||||
offlinePinVerify: (pin: string) => Promise<{ success: boolean; userId?: string; error?: string }>;
|
||||
|
||||
Reference in New Issue
Block a user