From afc2f2e9950f37776f255a59d6f770f84756be4b Mon Sep 17 00:00:00 2001 From: Paramesh Kamarthi Date: Tue, 6 Feb 2024 12:39:19 +0530 Subject: [PATCH 1/2] fix: updated options --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4c0619a..24c915f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,16 +50,17 @@ export const affinidiProvider = async (app: any, options: ProviderOptionsType) = passport.use(options.id, strategy) app.use( - expressSesssion( - options.expressSesssion || { + expressSesssion({ secret: options.id, resave: false, saveUninitialized: true, cookie: { secure: process.env.NODE_ENV === 'production', + sameSite: "none", maxAge: 1000 * 60 * 60 * 24 * 1, // 1 day }, unset: 'destroy', + ...options.expressSesssion }, ), ) From 8624036e8095ff240e85f7a489df8da9d91eb11d Mon Sep 17 00:00:00 2001 From: Paramesh Kamarthi Date: Tue, 6 Feb 2024 12:41:41 +0530 Subject: [PATCH 2/2] fix: updated options --- src/index.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/index.ts b/src/index.ts index 24c915f..f5b91eb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -51,18 +51,17 @@ export const affinidiProvider = async (app: any, options: ProviderOptionsType) = app.use( expressSesssion({ - secret: options.id, - resave: false, - saveUninitialized: true, - cookie: { - secure: process.env.NODE_ENV === 'production', - sameSite: "none", - maxAge: 1000 * 60 * 60 * 24 * 1, // 1 day - }, - unset: 'destroy', - ...options.expressSesssion + secret: options.id, + resave: false, + saveUninitialized: true, + cookie: { + secure: process.env.NODE_ENV === 'production', + sameSite: 'none', + maxAge: 1000 * 60 * 60 * 24 * 1, // 1 day }, - ), + unset: 'destroy', + ...options.expressSesssion, + }), ) if (options.passport?.initializeSession === true) {