deckhearth/pages/api/cards/[id]
Randall Stillwell f36fea8e58 🔐 Fix Card Detail Page Authentication Issues
 Authentication Headers Added:
- Added JWT tokens to all API calls in card detail page
- Fixed collections, decks, ownership, and favorites API calls
- Added proper error handling for authentication failures

🔧 Enhanced Ownership API:
- Added GET method to fetch user's card ownership
- Maintains existing POST method for updating ownership
- Returns user-specific quantity data

🎯 User Data Integration:
- Fetches user's owned quantity on page load
- Checks favorite status from user_favorites table
- Refreshes data after collection/deck additions
- All data now properly scoped to authenticated user

🛡️ Security Improvements:
- All API calls now include Authorization headers
- User-specific data fetching implemented
- No more reliance on global card data
- Proper JWT token validation throughout

The card detail page now properly integrates with the secured API endpoints and displays user-specific data correctly! 🃏🔒
2025-07-26 00:32:58 -05:00
..
collections.js 🔒 CRITICAL SECURITY FIX: Implement Proper User Data Isolation 2025-07-26 00:29:51 -05:00
decks.js 🔒 CRITICAL SECURITY FIX: Implement Proper User Data Isolation 2025-07-26 00:29:51 -05:00
favorite.js 🔒 CRITICAL SECURITY FIX: Implement Proper User Data Isolation 2025-07-26 00:29:51 -05:00
ownership.js 🔐 Fix Card Detail Page Authentication Issues 2025-07-26 00:32:58 -05:00