Skip to content

Commit a0247a5

Browse files
committed
Cookie settings
1 parent 94d81ed commit a0247a5

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

services/patient-service/src/modules/auth/auth.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class AuthController {
2525
res.cookie('refreshToken', result.refreshToken, {
2626
httpOnly: true,
2727
secure: process.env.NODE_ENV === 'production',
28-
sameSite: process.env.NODE_ENV === 'production' ? 'strict' : 'lax',
28+
sameSite: 'lax',
2929
path: '/',
3030
maxAge: 7 * 24 * 60 * 60 * 1000, // 7 days
3131
});
@@ -56,7 +56,7 @@ export class AuthController {
5656
res.cookie('refreshToken', tokens.refreshToken, {
5757
httpOnly: true,
5858
secure: process.env.NODE_ENV === 'production',
59-
sameSite: process.env.NODE_ENV === 'production' ? 'strict' : 'lax',
59+
sameSite: 'lax',
6060
path: '/',
6161
maxAge: 7 * 24 * 60 * 60 * 1000,
6262
});
@@ -139,7 +139,7 @@ export class AuthController {
139139
res.clearCookie('refreshToken', {
140140
httpOnly: true,
141141
secure: process.env.NODE_ENV === 'production',
142-
sameSite: process.env.NODE_ENV === 'production' ? 'strict' : 'lax',
142+
sameSite: 'lax',
143143
path: '/',
144144
});
145145

services/staff-service/src/modules/auth/admin.auth.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class AdminAuthController {
6969
res.cookie('staffRefreshToken', refreshToken, {
7070
httpOnly: true,
7171
secure: isProduction,
72-
sameSite: isProduction ? 'strict' : 'lax',
72+
sameSite: 'lax',
7373
path: '/',
7474
maxAge: 7 * 24 * 60 * 60 * 1000,
7575
});
@@ -150,7 +150,7 @@ export class AdminAuthController {
150150
res.clearCookie('staffRefreshToken', {
151151
httpOnly: true,
152152
secure: isProduction,
153-
sameSite: isProduction ? 'strict' : 'lax',
153+
sameSite: 'lax',
154154
path: '/',
155155
});
156156

services/staff-service/src/modules/auth/staff.auth.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class StaffAuthController {
105105
res.cookie('staffRefreshToken', refreshToken, {
106106
httpOnly: true,
107107
secure: isProduction,
108-
sameSite: isProduction ? 'strict' : 'lax',
108+
sameSite: 'lax',
109109
path: '/',
110110
maxAge: 7 * 24 * 60 * 60 * 1000,
111111
});
@@ -207,7 +207,7 @@ export class StaffAuthController {
207207
res.cookie('staffRefreshToken', newRefreshToken, {
208208
httpOnly: true,
209209
secure: isProduction,
210-
sameSite: isProduction ? 'strict' : 'lax',
210+
sameSite: 'lax',
211211
path: '/',
212212
maxAge: 7 * 24 * 60 * 60 * 1000,
213213
});
@@ -247,7 +247,7 @@ export class StaffAuthController {
247247
res.clearCookie('staffRefreshToken', {
248248
httpOnly: true,
249249
secure: isProduction,
250-
sameSite: isProduction ? 'strict' : 'lax',
250+
sameSite: 'lax',
251251
path: '/',
252252
});
253253

0 commit comments

Comments
 (0)