Skip to content

Validate follow targets#49

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix/follow-target-validation
Jul 9, 2026
Merged

Validate follow targets#49
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix/follow-target-validation

Conversation

@phucnguyen1707

Copy link
Copy Markdown
Contributor

Summary

  • validate follow/unfollow actions before touching the database
  • require the target user to resolve through the public profile lookup
  • return a clean 404 for missing, deleted, or suspended users instead of inserting a bad follow edge or surfacing a database error

Bug fixed

Direct requests to /api/follow could submit an arbitrary userId. The UI only exposes follow buttons for public profiles, but the API did not enforce the same target check before writing to follows. Invalid IDs could hit the users foreign key path, and hidden users could still be targeted directly.

Verification

  • pnpm --filter @aiornot/web typecheck
  • pnpm --filter @aiornot/web test
  • pnpm --filter @aiornot/web build

@ralyodio ralyodio merged commit 200edfe into profullstack:master Jul 9, 2026
5 checks passed
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.

2 participants