Commit Graph

15 Commits

Author SHA1 Message Date
Nils-Johan Gynther 0f71d2569b fix: force-dynamic pa write-sidan + saker useSession i useAuthFetch 2026-04-19 21:50:41 +02:00
Nils-Johan Gynther b4d9e3dd5f refactor: useAuthFetch-hook för automatisk JWT-header i klientanrop 2026-04-19 21:48:13 +02:00
Nils-Johan Gynther b34f141967 fix: withAuth standalone fallback om request.auth saknar accessToken 2026-04-19 21:25:36 +02:00
Nils-Johan Gynther ff0859a7b1 debug: lägg till withAuth-loggning + middleware matcher för /api 2026-04-19 21:24:53 +02:00
Nils-Johan Gynther 722440b9b5 fix: konvertera alla API route handlers till withAuth wrapper
Ersätter getAuthHeaders() + auth() standalone med withAuth() wrapper
i alla route handlers. Auth() standalone fungerar inte korrekt i
Next.js 16 + NextAuth beta.28 pga async cookies() kompatibilitet.
withAuth() använder auth() i wrapper-form sa att request.auth
populeras direkt av NextAuth.

Pavaerkade filer: 27 route handlers + ny lib/with-auth.ts
2026-04-19 21:11:14 +02:00
Nils-Johan Gynther 6c4683242c feat(auth): enhance logging for JWT and session handling in auth callbacks 2026-04-19 16:59:34 +02:00
Nils-Johan Gynther 28e938e66e feat(api): use dynamic import for auth headers in fetchJson function 2026-04-17 20:29:52 +02:00
Nils-Johan Gynther 8b9ec31dee fix(api): handle 401 responses by redirecting to login 2026-04-17 20:26:28 +02:00
Nils-Johan Gynther 5179e5c5be feat(api): enhance fetchJson to include authentication headers for server requests 2026-04-17 20:19:42 +02:00
Nils-Johan Gynther e06d05e8db feat(auth): refactor sign-out functionality and update import paths 2026-04-17 19:58:45 +02:00
Nils-Johan Gynther ce0cc6fbf0 feat(auth): implement user authentication with JWT and NextAuth
- Added user registration and login functionality with JWT authentication.
- Created auth controller, service, and module in the backend.
- Implemented user model and user products management.
- Integrated NextAuth for session management on the frontend.
- Added middleware for protecting routes and handling public access.
- Updated frontend API routes to include authorization headers.
- Enhanced recipe and user product models to support ownership and visibility.
- Created registration and login pages in the frontend.
- Added necessary types for NextAuth session management.
2026-04-17 19:57:08 +02:00
Nils-Johan Gynther d5b360fd62 Refactor logging in IcaRecipeParser and QuickImportService to use NestJS Logger
- Updated IcaRecipeParser to replace console.log statements with Logger for better logging practices.
- Enhanced QuickImportService with Logger for consistent logging and error handling.
- Changed quantity validation in CreateRecipeIngredientDto and CreateRecipeDto to allow zero.
- Removed CanonicalNameForm and NameForm components from the frontend.
- Updated EditProductForm to use a select dropdown for categories instead of a text input.
- Added validation for product name, canonical name, and category length in product update action.
- Refactored unit options into a separate file for better reusability across components.
- Removed unused API fetching functions and inventory types to clean up the codebase.
2026-04-16 18:18:27 +02:00
Nils-Johan Gynther 2efb5b5627 Implement health check service and global exception handling 2026-04-10 18:14:48 +02:00
Nils-Johan Gynther 32e643f6ab Refactor fetchJson function to use relative paths in the browser and avoid mixed content issues 2026-04-09 23:58:19 +02:00
nilsjohan 962f4e4be5 Recipe-app main 2026-04-09 09:14:39 +02:00