oauth: persist client state, simplify IPC, and refactor

connected-accounts UI

This refactor simplifies OAuth storage/IPC and updates the Electron UI
to use the new client-facing contract. OAuth state is now persisted per
provider with tokens, optional clientId, and an error string. A new oauth:getState
IPC returns only client-facing state (connected + error), and the UI renders
error/reconnect flow based on that.

  Core changes
  - Replace OAuth config with providers { tokens, clientId?, error? }
    and add zod-based migration from legacy token maps.
  - Persist Google clientId after successful OAuth and keep error state
    in repo.
  - Surface provider errors from refresh/credential failures in Google +
    Fireflies.
  - Add oauth:getState in IPC, returning client-facing config; remove
    old status wiring in the UI.

  UI changes
  - Switch renderer status checks to oauth:getState and derive connected/error
    from config.
  - Add alert dialog for account issues and update copy to “Connected
    accounts”.
  - Provide “View connected accounts” CTA that opens the Connectors popover.
  - Add shadcn alert-dialog component and Radix dependency.

  Notes
  - Adds @radix-ui/react-alert-dialog and shadcn wrapper.
  - pnpm-lock updated accordingly.
This commit is contained in:
Ramnique Singh 2026-02-17 09:54:34 +05:30
parent 492b59e2e8
commit 9d4f25895e
15 changed files with 1292 additions and 206 deletions

View file

@ -233,24 +233,19 @@ const ipcSchemas = {
success: z.boolean(),
}),
},
'oauth:is-connected': {
req: z.object({
provider: z.string(),
}),
res: z.object({
isConnected: z.boolean(),
}),
},
'oauth:list-providers': {
req: z.null(),
res: z.object({
providers: z.array(z.string()),
}),
},
'oauth:get-connected-providers': {
'oauth:getState': {
req: z.null(),
res: z.object({
providers: z.array(z.string()),
config: z.record(z.string(), z.object({
connected: z.boolean(),
error: z.string().optional(),
})),
}),
},
'oauth:didConnect': {