aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/index.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts
index e396151..a456313 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -6,15 +6,18 @@ import path from 'path';
import { env } from 'process';
import helmet from 'helmet';
import csurf from 'csurf';
+import cookieParser from 'cookie-parser';
+import { randomBytes } from 'crypto';
const app = express();
// Middleware
const port: string = env.PORT || '2000';
-const csrf = csurf({ cookie: false });
+app.use(cookieParser());
+const csrf = csurf({ cookie: true });
app.use(session({
- secret: 'keyboard cat',
+ secret: randomBytes(50).toString('base64'),
resave: false,
saveUninitialized: true,
cookie: {