From 861aeb58a561c22d88f7808257edaaf80f26c8b2 Mon Sep 17 00:00:00 2001 From: Ryan Cannon Date: Mon, 29 Jan 2018 15:58:17 +0000 Subject: [PATCH] [express-session]: Allow secret to be an array From [the readme](https://github.com/expressjs/session#secret): > This is the secret used to sign the session ID cookie. This can be either a string for a single secret, or an array of multiple secrets. If an array of secrets is provided, only the first element will be used to sign the session ID cookie, while all the elements will be considered when verifying the signature in requests. --- types/express-session/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index 13ce6ab8b2..20343873f1 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for express-session 1.15 // Project: https://www.npmjs.org/package/express-session -// Definitions by: Hiroki Horiuchi , Jacob Bogers +// Definitions by: Hiroki Horiuchi +// Jacob Bogers +// Ryan Cannon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -51,7 +53,7 @@ declare function session(options?: session.SessionOptions): express.RequestHandl declare namespace session { interface SessionOptions { - secret: string; + secret: string | string[]; name?: string; store?: Store | MemoryStore; cookie?: express.CookieOptions;