Josh Creek 3aa716b941 fix(#55): implement user data isolation to prevent cross-user data access
- Add server-side authentication validation for all protected API endpoints
- Create auth utility with requireAuth() function for session validation
- Update CombinedDataRepository to filter data by authenticated user ID
- Add findByUserId() method to CatchRecordRepository for user-specific queries
- Replace client-side userId parameters with server-side session extraction
- Use MongoDB aggregation with $lookup and $expr for secure user filtering
- Return 401 errors for unauthenticated requests
- Fix critical security vulnerability where users could see others' catch records

Fixes: User data isolation bug where one user's catch records were used for everyone
Security: Prevents unauthorized access to other users' Pokemon tracking data
2025-07-26 16:34:19 +01:00
2024-07-16 21:43:41 +01:00
2024-04-14 16:03:01 +01:00
2024-04-06 21:10:37 +01:00
2024-04-07 15:44:17 +01:00
2024-03-09 21:28:07 +00:00
2024-03-09 21:28:07 +00:00
2024-03-09 21:09:47 +00:00
2024-03-09 21:32:50 +00:00
2024-04-07 15:12:59 +01:00
2024-04-14 16:03:01 +01:00
2024-07-16 21:43:41 +01:00
2024-07-15 20:49:36 +01:00

Living Dex Tracker

A web app to track completion of a living Pokédex.

Developing

Cloned the repository you can install the dependencies with npm install, and start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

An example .env file is provided in the repository. You will need to copy .env.example to .env and fill in the values with your own credentials.

Once you have done this, you can seed the Pokédex data using the /api/seed endpoint. You will need to comment out the return; at the beginning of the GET function in /src/routes/api/seed.ts to do this. Make sure you remember to uncomment it afterwards.

Building

To create a production version:

npm run build

You can preview the production build with npm run preview.

Hosting

The app is hosted on Netlify at pokedex.jcreek.co.uk.

The Pokédex data is stored in a MongoDB database hosted on MongoDB Cloud.

User authentication is handled by Supabase Auth.

Dependencies

The living dex tracker's sprite collection is taken from PokéAPI Sprites, which is licensed under the Creative Commons CC0 1.0 Universal license.

S
Description
No description provided
Readme GPL-3.0 412 MiB
Languages
TypeScript 45.8%
Svelte 45.1%
PLpgSQL 5.5%
JavaScript 3.3%
HTML 0.3%