Skip to content

worker: add GitHub OAuth callback route - #29

Merged
MekDrop merged 1 commit into
mainfrom
feat/issue-6-github-oauth-callback
Apr 23, 2026
Merged

MekDrop merged 1 commit into
mainfrom
feat/issue-6-github-oauth-callback

Conversation

@MekDrop

@MekDrop MekDrop commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds worker/src/routes/auth.js with a githubCallback handler that implements the GitHub OAuth code-for-token exchange
  • On success, redirects the user to ${SPA_URL}/#/auth/github?token=<access_token>
  • On failure (missing code or token exchange error), redirects to ${SPA_URL}/#/login?error=<message>
  • Registers the route GET /auth/github/callback in worker/src/index.js

Test plan

  • Deploy worker to a preview environment with GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, and SPA_URL set
  • Initiate the OAuth flow from the SPA and verify a successful redirect lands at /#/auth/github?token=...
  • Hit /auth/github/callback with no code param and verify redirect to /#/login?error=missing_code
  • Simulate a bad code and verify redirect to /#/login?error=<github error message>
  • Confirm GITHUB_CLIENT_SECRET never appears in any response body or log

Closes #6

@MekDrop
MekDrop merged commit 47e008f into main Apr 23, 2026
1 check passed
@MekDrop
MekDrop deleted the feat/issue-6-github-oauth-callback branch April 23, 2026 00:30
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.

Worker: GitHub OAuth callback route (code → token exchange)

1 participant