fix: add cookie-parser middleware to fix 403 on protected routes, add autocomplete to login
This commit is contained in:
+8
-1
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user