Merged
Conversation
* main: Add .github/copilot-instructions.md Initial plan
There was a problem hiding this comment.
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. |
Owner
Author
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Contributor
Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com>
OAuth security hardening & bug fixes from PR review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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