Skip to content

OAuth Support#106

Merged
acrosman merged 29 commits intomainfrom
features/issue-55-oauth
Mar 10, 2026
Merged

OAuth Support#106
acrosman merged 29 commits intomainfrom
features/issue-55-oauth

Conversation

@acrosman
Copy link
Copy Markdown
Owner

@acrosman acrosman commented Mar 9, 2026

The replaces the existing login solution with OAuth support. Includes setup instructions in the readme file to handle creating an external client app. Significant real-world testing needed before merge.

This also adds a battery of Jest tests with a workflow to run them. Test coverage should be expanded in another PR for #27.

Closes #55

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the prior password-based Salesforce login flow with an OAuth (External Client App / Connected App) flow in the Electron main process, adds persistent settings for OAuth credentials, and introduces a Jest-based test suite plus a CI workflow to run it.

Changes:

  • Implement OAuth login (sf_oauth_start) with a localhost callback server and token exchange via JSForce.
  • Add persistent settings storage (src/settings.js) and renderer UI wiring for Settings load/save via IPC.
  • Add Jest tests (main process, renderer, settings) and a GitHub Actions workflow to run npm test.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/electronForce.js Adds OAuth flow, settings IPC handlers, and shared connection creation helper.
src/settings.js Implements read/write of settings in userData/settings.json with defaults.
app/render.js Adds OAuth + settings IPC handlers and replaces login UI trigger with OAuth start.
app/preload.js Updates IPC allow-lists for new OAuth/settings channels.
app/index.html Replaces login form with OAuth authorize button; adds Settings modal.
main.js Adjusts navigation/redirect blocking behavior for OAuth-era flow.
tests/*.test.js Adds unit tests for settings, renderer handlers, and OAuth/login handler behavior.
__mocks__/electron.js Adds shared Electron manual mock for tests.
.github/workflows/tests.yml Adds CI workflow to run Jest tests on pushes/PRs.
package.json / package-lock.json Adds jsdom test environment dependency and lockfile updates.
ReadMe.md Documents External Client App setup and OAuth-based connection flow.
.github/copilot-instructions.md Documents new settings module, test mocks, and OAuth conventions.

@acrosman
Copy link
Copy Markdown
Owner Author

acrosman commented Mar 9, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

@acrosman I've opened a new pull request, #107, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits March 9, 2026 17:00
Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com>
OAuth security hardening & bug fixes from PR review
@acrosman acrosman mentioned this pull request Mar 9, 2026
@acrosman acrosman merged commit 56bff9f into main Mar 10, 2026
2 checks passed
This was referenced Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup OAuth

3 participants