Skip to content

Commit

Permalink
feat: fix cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
liorzblrn committed Jan 3, 2025
1 parent ffb1857 commit 0d52d86
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions services/workflows-service/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ const main = async () => {

app.use(json({ limit: '50mb' }));
app.use(urlencoded({ limit: '50mb', extended: true }));

const isLocal = process.env.ENVIRONMENT_NAME === 'local';

app.use(
cookieSession({
name: 'session',
keys: [env.SESSION_SECRET],
httpOnly: env.ENVIRONMENT_NAME === 'local',
secure: env.ENVIRONMENT_NAME !== 'local' ? true : false,
sameSite: env.ENVIRONMENT_NAME !== 'local' ? 'strict' : false,
httpOnly: !isLocal,
secure: !isLocal,
sameSite: !isLocal ? 'strict' : false,
maxAge: 1000 * 60 * env.SESSION_EXPIRATION_IN_MINUTES,
}),
);
Expand Down

0 comments on commit 0d52d86

Please sign in to comment.