deckhearth/lib
Randall Stillwell 7c9368a739 🔐 Fix Authentication Issues in Collection Pages
🐛 Fixed Authentication Problems:
- Removed hardcoded mock admin user from collection detail page
- Removed hardcoded mock user from collections page
- Created proper useAuth hook to get current authenticated user
- Added proper authentication checks and redirects

🔧 Authentication Flow Fixes:
- Collection detail page now uses actual logged-in user (Alice, Bob, etc.)
- Proper permission checks based on real user identity
- Edit/Delete buttons now show correctly based on actual ownership
- Authentication loading states handled properly

🛠️ Technical Improvements:
- Created lib/use-auth.js hook for consistent auth handling
- Added auth loading states to prevent flash of wrong content
- Proper redirects to login page when not authenticated
- Fixed token retrieval from localStorage ('auth_token')

 User Experience:
- Alice and Bob now see their own collections correctly
- Edit/Delete permissions work based on actual collection ownership
- No more authentication errors when editing owned collections
- Consistent user identity across all pages

The authentication system now works correctly with the demo users! 🎯
2025-07-26 22:23:31 -05:00
..
admin-auth.js Integrated real database authentication with JWT tokens 2025-07-24 16:36:10 -05:00
auth-context.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
database.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
permission-middleware.js 🔒 CRITICAL SECURITY FIX: Implement Proper User Data Isolation 2025-07-26 00:29:51 -05:00
slug-utils.js 🔗 Implement Collection Slug URLs 2025-07-26 22:06:52 -05:00
theme-context.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
use-auth.js 🔐 Fix Authentication Issues in Collection Pages 2025-07-26 22:23:31 -05:00