backend: remove MEET_COOKIE_SECURE env var and update cookie options for secure and sameSite attributes
This commit is contained in:
parent
9564c7e751
commit
b13f18b4d3
@ -33,8 +33,6 @@ export const {
|
|||||||
MEET_INITIAL_ADMIN_PASSWORD = 'admin',
|
MEET_INITIAL_ADMIN_PASSWORD = 'admin',
|
||||||
MEET_INITIAL_API_KEY = '',
|
MEET_INITIAL_API_KEY = '',
|
||||||
|
|
||||||
MEET_COOKIE_SECURE = 'false',
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Webhook configuration
|
* Webhook configuration
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
import { CookieOptions } from 'express';
|
import { CookieOptions } from 'express';
|
||||||
import ms, { StringValue } from 'ms';
|
import ms, { StringValue } from 'ms';
|
||||||
import { MEET_COOKIE_SECURE } from '../environment.js';
|
|
||||||
|
|
||||||
export const getCookieOptions = (path: string, expiration?: string): CookieOptions => {
|
export const getCookieOptions = (path: string, expiration?: string): CookieOptions => {
|
||||||
return {
|
return {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: MEET_COOKIE_SECURE === 'true',
|
secure: true,
|
||||||
sameSite: 'strict',
|
sameSite: 'none',
|
||||||
maxAge: expiration ? ms(expiration as StringValue) : undefined,
|
maxAge: expiration ? ms(expiration as StringValue) : undefined,
|
||||||
path
|
path
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user