processing / processing/p5.js-web-editor

OAuth unlink routes missing isAuthenticated middleware.

Open
#3,951 5 comments 0 reactions 1 assignee View on GitHub

@Piyushrathoree is already working on this.

Since Sep 18, 2026.

Bug
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

p5.js version

No response

What is your operating system?

None

Web browser and version

No response

Actual Behavior

The DELETE /auth/github and DELETE /auth/google routes in

server/routes/user.routes.ts
do not use the isAuthenticated middleware. Every other account-management route in the same file uses it (PUT /account, POST /account/api-keys, PUT /cookie-consent, PUT /preferences).

Without the middleware, unauthenticated requests receive a 404 status from the controller's inline guard instead of the standard 401.
The JSDoc for both handlers in authManagement.ts even notes Authenticated: false -- TODO: update to true?.

Expected Behavior

Both routes should use isAuthenticated middleware, returning 401 for unauthenticated requests — consistent with every other account route.

Steps to reproduce
Steps:
  1. Start the dev server with npm start
  2. Without logging in, send DELETE /auth/github (e.g. via curl)
  3. Observe: response is 404 with "You must be logged in..."
  4. Expected: response should be 401 (from isAuthenticated middleware)
Relevant code:
// server/routes/user.routes.ts lines 48-51
// DELETE /auth/github
router.delete('/auth/github', UserController.unlinkGithub);        // ← missing isAuthenticated
// DELETE /auth/google
router.delete('/auth/google', UserController.unlinkGoogle);        // ← missing isAuthenticated

// Compare with adjacent route (line 47):
router.put('/account', isAuthenticated, UserController.updateSettings);  // ← has it

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.