Skip to content

fix(event): replace organizerId with organizer public fields in GET /:slug#346

Open
anshul23102 wants to merge 1 commit into
Dev-Card:mainfrom
anshul23102:fix/330-event-slug-exposes-organizer-uuid
Open

fix(event): replace organizerId with organizer public fields in GET /:slug#346
anshul23102 wants to merge 1 commit into
Dev-Card:mainfrom
anshul23102:fix/330-event-slug-exposes-organizer-uuid

Conversation

@anshul23102
Copy link
Copy Markdown
Contributor

Summary

Fixes #330

  • The GET /events/:slug endpoint was returning organizerId (a raw internal database UUID) in the response, leaking a private identifier to any caller including unauthenticated ones.
  • Added an organizer relation join to the Prisma query (select: { username, displayName }).
  • Replaced organizerId: string in the EventDetails response type with organizerUsername: string and organizerDisplayName: string.
  • The response now exposes only the organizer's public profile fields, consistent with how attendee profiles are handled elsewhere in the same file.

Changes

  • apps/backend/src/routes/event.ts: updated EventDetails type, Prisma findUnique include, and response object mapping.

Test plan

  • GET /events/:slug for an existing event returns organizerUsername and organizerDisplayName instead of organizerId.
  • GET /events/:slug for a non-existent slug still returns 404.
  • No TypeScript compilation errors (tsc --noEmit).

…:slug response

The event detail endpoint was returning the raw organizer UUID via
organizerId, leaking an internal database identifier to unauthenticated
callers. Fetch the organizer relation and expose organizerUsername and
organizerDisplayName instead.
@anshul23102
Copy link
Copy Markdown
Contributor Author

@Neit6138 could you please add the relevant labels to this PR? It would help with tracking. Thank you!

@Harxhit Harxhit added the gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: GET /api/events/:slug exposes internal organizerId UUID to unauthenticated callers

2 participants