backend: add MEET_COOKIE_SECURE env var for cookie security settings
This commit is contained in:
parent
98764597e2
commit
b2eb0b5439
@ -25,6 +25,7 @@ export const {
|
||||
MEET_API_KEY = '',
|
||||
MEET_ADMIN_USER = 'admin',
|
||||
MEET_ADMIN_SECRET = 'admin',
|
||||
MEET_COOKIE_SECURE = 'false',
|
||||
|
||||
// Token expiration times
|
||||
MEET_ACCESS_TOKEN_EXPIRATION = '2h',
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
import { CookieOptions } from 'express';
|
||||
import ms, { StringValue } from 'ms';
|
||||
import { MEET_COOKIE_SECURE } from '../environment.js';
|
||||
|
||||
export const getCookieOptions = (path: string, expiration: string): CookieOptions => {
|
||||
return {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
secure: MEET_COOKIE_SECURE === 'true',
|
||||
sameSite: 'strict',
|
||||
maxAge: ms(expiration as StringValue),
|
||||
path
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user