fix: add cookie-parser middleware to fix 403 on protected routes, add autocomplete to login

This commit is contained in:
Mohan Ki
2026-07-27 16:12:02 +05:30
parent 5a7b4c7470
commit 0e379f4e15
3 changed files with 10 additions and 1 deletions
+8 -1
View File
@@ -10,8 +10,15 @@ require('dotenv').config();
const app = express();
const port = process.env.PORT || 4001;
app.use(cors({ origin: 'http://localhost:4000', credentials: true }));
const allowedOrigins = [
'http://localhost:4000',
'https://qr.houseofwebsites.ai',
process.env.FRONTEND_URL
].filter(Boolean);
app.use(cors({ origin: allowedOrigins, credentials: true }));
app.use(express.json());
app.use(cookieParser());
// Routes
const authRoutes = require('./routes/auth');