feat: remove csrf

This commit is contained in:
karishmas6
2024-10-12 22:46:41 +05:30
parent 946c237755
commit 8381f1af83

View File

@@ -16,8 +16,6 @@ import { Server } from "socket.io";
import { readdirSync } from "fs" import { readdirSync } from "fs"
import { fork } from 'child_process'; import { fork } from 'child_process';
const csrfProtection = csrf({ cookie: true })
const app = express(); const app = express();
app.use(cors({ app.use(cors({
origin: 'http://localhost:3000', origin: 'http://localhost:3000',
@@ -39,10 +37,9 @@ export const io = new Server(server);
export const browserPool = new BrowserPool(); export const browserPool = new BrowserPool();
app.use(bodyParser.json({ limit: '10mb' })) app.use(bodyParser.json({ limit: '10mb' }))
app.use(bodyParser.urlencoded({ extended: true, limit: '10mb', parameterLimit: 10000 })); app.use(bodyParser.urlencoded({ extended: true, limit: '10mb', parameterLimit: 9000 }));
// parse cookies - "cookie" is true in csrfProtection // parse cookies - "cookie" is true in csrfProtection
app.use(cookieParser()) app.use(cookieParser())
app.use(csrfProtection)
app.use('/record', record); app.use('/record', record);
app.use('/workflow', workflow); app.use('/workflow', workflow);
@@ -76,10 +73,6 @@ app.get('/', function (req, res) {
return res.send('Maxun server started 🚀'); return res.send('Maxun server started 🚀');
}); });
app.get('/csrf-token', (req, res) => {
res.json({ csrfToken: req.csrfToken() })
})
server.listen(SERVER_PORT, async () => { server.listen(SERVER_PORT, async () => {
await connectDB(); await connectDB();
await syncDB(); await syncDB();