mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-20 18:08:55 +00:00
The "Get Authorization Code" button silently failed on Flatpak because shell.openExternal rejects without renderer feedback when the org.freedesktop.portal.Desktop talk-name isn't granted. After the user gave up and reopened the dialog, the second attempt failed again with `invalid_grant: invalid code verifier` because each call to Dropbox.getAuthHelper() generated a fresh PKCE verifier that no longer matched the originally-shown URL's challenge. Three changes: - Cache the in-flight PKCE Promise on the Dropbox provider so concurrent callers and consecutive dialog opens share one verifier+URL pair. Cleared on successful exchange, on clearAuthCredentials(), and on a rejected generation (so a one-time crypto failure doesn't poison the session). Five regression tests cover reuse, success-clear, explicit clear, concurrent calls, and rejection-recovery. - Render the auth URL as user-selectable text under a <details> disclosure. Escape hatch when both shell.openExternal and the clipboard portal are denied — the user can triple-click to select and Ctrl+C the URL into a manually-opened browser. Adds D_AUTH_CODE.MANUAL_URL_HINT translation key. - Pipe shell.openExternal rejections through errorHandlerWithFrontendInform so the existing IPC.ERROR snack channel surfaces a "Could not open the link in your browser" message instead of swallowing the failure to electron-log. Wrapped in a try/catch since errorHandlerWithFrontendInform throws synchronously if the renderer isn't ready. The Flathub manifest also needs --talk-name=org.freedesktop.portal.Desktop and --socket=wayland to fully fix the user-reported issue, but that change lives in the flathub repo. |
||
|---|---|---|
| .. | ||
| assets/icons | ||
| ipc-handlers | ||
| scripts | ||
| shared-with-frontend | ||
| task-widget | ||
| wayland-idle-helper | ||
| backup.ts | ||
| clear-stale-idb-locks.ts | ||
| clipboard-image-handler.ts | ||
| common.const.ts | ||
| CONFIG.ts | ||
| debug.ts | ||
| electronAPI.d.ts | ||
| error-handler-with-frontend-inform.ts | ||
| full-screen-blocker.ts | ||
| gpu-startup-guard.ts | ||
| idle-time-handler.ts | ||
| indicator.ts | ||
| ipc-handler-wrapper.ts | ||
| ipc-handler.ts | ||
| jira.ts | ||
| local-file-sync.ts | ||
| local-rest-api.ts | ||
| lockscreen.ts | ||
| main-window.ts | ||
| main.ts | ||
| plugin-node-executor.ts | ||
| plugin-oauth.ts | ||
| preload.ts | ||
| protocol-handler.ts | ||
| proxy-agent.ts | ||
| shared-state.ts | ||
| simple-store.test.cjs | ||
| simple-store.ts | ||
| start-app.ts | ||
| tsconfig.electron.json | ||
| various-shared.ts | ||