Skip to content

Commit b96e5fd

Browse files
committed
refactor: Remove cookie domain attribute
1 parent f36ed47 commit b96e5fd

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

config/env/.env.template

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ API_BASE_URL=http://localhost:3000
55
# frontend website (for handling cors and cookie), acccepts comma-separated-values
66
FRONTEND_WEBSITE_URLS=FRONTEND_WEBSITE_URL_1,FRONTEND_WEBSITE_URL_2
77

8-
# used to secure live environments, should allow both frontend/backend domains (do not include protocol)
9-
COOKIE_DOMAIN=COOKIE_DOMAIN
10-
118
# plugin configurations
129
MAX_PLUGIN_IMAGE_FILE_SIZE=1048576 # (bytes)
1310

src/api/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ app.use(
137137
secure: process.env.NODE_ENV !== 'local',
138138
// in production, use "lax" as frontend and backend have the same root domain
139139
sameSite: process.env.NODE_ENV === 'local' ? 'none' : 'lax',
140-
// if not in production, leave domain as undefined
141-
domain: process.env.NODE_ENV === 'local' ? undefined : process.env.COOKIE_DOMAIN,
142140
// expire after 3 months (milliseconds)
143141
maxAge: 1000 * 60 * 60 * 24 * 30 * 3,
144142
},

src/api/middleware/csrfMiddleware.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const csrfMiddleware: RequestHandler = (req, res, next) => {
1818
secure: process.env.NODE_ENV !== 'local',
1919
// in production, use "lax" as frontend and backend have the same root domain
2020
sameSite: process.env.NODE_ENV === 'local' ? 'none' : 'lax',
21-
// if not in production, leave domain as undefined
22-
domain: process.env.NODE_ENV === 'local' ? undefined : process.env.COOKIE_DOMAIN,
2321
});
2422
return next();
2523
}

0 commit comments

Comments
 (0)