OAuth security hardening & bug fixes from PR review#107
Merged
acrosman merged 2 commits intofeatures/issue-55-oauthfrom Mar 9, 2026
Merged
OAuth security hardening & bug fixes from PR review#107acrosman merged 2 commits intofeatures/issue-55-oauthfrom
acrosman merged 2 commits intofeatures/issue-55-oauthfrom
Conversation
Merged
Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add OAuth support for login functionality
OAuth security hardening & bug fixes from PR review
Mar 9, 2026
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.
Addresses seven review comments on the OAuth Support PR covering CSRF exposure, insecure server binding, a broken settings save response, and related issues.
Security
crypto.randomBytes(16).toString('hex')state token is now included in the authorization URL and validated in/callbackbefore code exchange; missing/mismatched state → 400 +response_generic127.0.0.1instead of all interfaces;server.on('error', ...)added to handleEADDRINUSEgracefullywill-navigate/will-redirectnow compare against the exactfile://…/app/index.htmlURL rather than accepting anyfile://pathCorrectness
createConnectionguard – throws"Not connected to org: <id>"when the org is absent; all handlers moved to call it insidetry/catchwithconn?.limitInfo || {}in catch blocks;sf_logoutusesdelete sfConnections[org]instead of= nullsf_save_settingsresponse – was returning thesaveSettings()boolean; now returns the saved settings object (minusconsumerSecret).render.jsupdated to skip overwriting the secret field when absent from the response, so the form isn't cleared after a saveDocs & dependencies
jest-environment-jsdomdowngraded v30 → v29 to matchjestv29refresh_token(removes undocumentedoffline_access)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.