Browse Source

fix(core): Fix regression in cookie middleware when no name provided

Relates to #2880
Michael Bromley 1 year ago
parent
commit
fd729fd1ea
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core/src/bootstrap.ts

+ 1 - 1
packages/core/src/bootstrap.ts

@@ -413,7 +413,7 @@ export function configureSessionCookies(
 
     // If the Admin API and Shop API should have the same cookie name
     // Else, the specific cookie middlewares are handled in the 'AppModule#configure' method
-    if (typeof cookieOptions?.name === 'string') {
+    if (typeof cookieOptions?.name === 'string' || cookieOptions?.name === undefined) {
         app.use(
             cookieSession({
                 ...cookieOptions,