Skip to content

fix: remove github_follow token when disconnecting github account#529

Open
anirudhagarwal-dev wants to merge 2 commits into
Dev-Card:mainfrom
anirudhagarwal-dev:fix/github-follow-token-deletion
Open

fix: remove github_follow token when disconnecting github account#529
anirudhagarwal-dev wants to merge 2 commits into
Dev-Card:mainfrom
anirudhagarwal-dev:fix/github-follow-token-deletion

Conversation

@anirudhagarwal-dev

Copy link
Copy Markdown

Summary

This PR resolves a bug where the github_follow OAuth token remained in the database even after a user disconnected their GitHub account. This was caused by the disconnect endpoint not recognizing github_follow as a supported platform and only targeting the primary github token.

Closes #458


Type of Change

  • Bug fix
  • Tests only

What Changed

  • Backend Route Logic: Updated the DELETE /api/connect/:platform route in connect.ts to include github_follow in the supported platforms list.
  • Transaction-like Deletion: When disconnecting github, the system now uses deleteMany to remove both the github (login) and github_follow (follow-capable) tokens in a single operation.
  • Improved Testing: Added comprehensive unit tests in connect.test.ts to verify that both tokens are removed during a GitHub disconnect and that the endpoint handles other platforms and error states correctly.

How to Verify

  1. Run the backend unit tests:
    npm --prefix apps/backend run test src/__tests__/connect.test.ts

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@anirudhagarwal-dev is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Hi @anirudhagarwal-dev,

Thanks for opening this pull request.

This PR has been automatically classified based on the files modified.

Applied Labels

  • backend
  • web

Primary Review Area

  • backend

Reviewer

@Harxhit has been identified as the primary reviewer for this pull request.

If you have any questions regarding the affected area or implementation details, feel free to reach out to the assigned reviewer.

Thank you for your contribution!

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

CI — Checks Failed

Backend — FAIL

Check Result
Lint FAIL
Test PASS
Typecheck PASS

Mobile — SKIP

Check Result
Lint -
Test -

Web — FAIL

Check Result
Check FAIL
Build FAIL

Last updated: Tue, 09 Jun 2026 12:19:41 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: DELETE /api/connect/:platform cannot remove github_follow token, leaving follow-capable OAuth credentials permanently in the database

1 participant