
2025-07-18 17:39:35
Day 18
Today I debugged an issue with accessing backend endpoints from a Next.js frontend talking to a NestJS API.
The browser was blocking requests due to a CORS error — the Authorization header was not allowed in the preflight response. Even though frontend domains were correctly set, I forgot to include Authorization in allowedHeaders.
After updating enableCors() to:
`allowedHeaders: 'Authorization, Content-Type, Accept'`
…the issue disappeared, and t…