Skip to content

Commit 7d2d770

Browse files
committed
chore: Minor enhancements
1 parent 86eff2e commit 7d2d770

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

config/env/.env.template

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ FRONTEND_WEBSITE_URLS=FRONTEND_WEBSITE_URL_1,FRONTEND_WEBSITE_URL_2
88
# plugin configurations
99
MAX_PLUGIN_IMAGE_FILE_SIZE=1048576 # (bytes)
1010

11-
# session secret
11+
# CSRF token identifier
12+
CSRF_TOKEN_IDENTIFIER="LOCAL-XSRF-TOKEN"
13+
14+
# session name and secret
15+
SESSION_IDENTIIFIER=local-connect.sid
1216
SESSION_SECRET=SESSION_SECRET
1317

1418
# github application info and encyption key for access token
@@ -59,7 +63,4 @@ LOG_LEVEL=INFO
5963

6064
# OpenTelemetry Configuration
6165
OTEL_SERVICE_NAME=otel-collector
62-
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
63-
64-
# CSRF token identifier
65-
CSRF_TOKEN_IDENTIFIER="LOCAL-XSRF-TOKEN"
66+
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317

src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ app.set('trust proxy', true);
127127
// handles user session
128128
app.use(
129129
session({
130+
name: process.env.SESSION_NAME || 'connect.sid',
130131
store: redisSessionStore,
131132
secret: process.env.SESSION_SECRET as string,
132133
resave: false,

src/api/middleware/csrfMiddleware.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const csrfMiddleware: RequestHandler = (req, res, next) => {
2020
secure: process.env.NODE_ENV !== 'local',
2121
// in production, use "lax" as frontend and backend have the same root domain
2222
sameSite: process.env.NODE_ENV === 'local' ? 'none' : 'lax',
23+
domain: '.react-chatbotify.com',
2324
});
2425
return next();
2526
}

0 commit comments

Comments
 (0)