mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Updated express-session types (#40314)
- Allow `secure: 'auto'` cookie setting - Restrict `sameSite` cookie setting to boolean or valid string value according to (draft) spec
This commit is contained in:
committed by
Sheetal Nandi
parent
779fdbf9df
commit
aa52de569b
@@ -7,6 +7,22 @@ app.use(session({
|
||||
secret: 'keyboard cat',
|
||||
cookie: { secure: true }
|
||||
}));
|
||||
app.use(session({
|
||||
secret: 'keyboard cat',
|
||||
cookie: { secure: 'auto' }
|
||||
}));
|
||||
app.use(session({
|
||||
secret: 'keyboard cat',
|
||||
cookie: { sameSite: 'none' }
|
||||
}));
|
||||
app.use(session({
|
||||
secret: 'keyboard cat',
|
||||
cookie: { sameSite: 'lax' }
|
||||
}));
|
||||
app.use(session({
|
||||
secret: 'keyboard cat',
|
||||
cookie: { sameSite: 'strict' }
|
||||
}));
|
||||
app.use(session({
|
||||
secret: 'keyboard cat',
|
||||
name: 'connect.sid',
|
||||
|
||||
Vendored
+12
-1
@@ -4,6 +4,7 @@
|
||||
// Jacob Bogers <https://github.com/jacobbogers>
|
||||
// Naoto Yokoyama <https://github.com/builtinnya>
|
||||
// Ryan Cannon <https://github.com/ry7n>
|
||||
// Tom Spencer <https://github.com/fiznool>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -58,7 +59,17 @@ declare namespace session {
|
||||
secret: string | string[];
|
||||
name?: string;
|
||||
store?: Store | MemoryStore;
|
||||
cookie?: express.CookieOptions;
|
||||
cookie?: {
|
||||
maxAge?: number;
|
||||
signed?: boolean;
|
||||
expires?: Date;
|
||||
httpOnly?: boolean;
|
||||
path?: string;
|
||||
domain?: string;
|
||||
secure?: boolean | 'auto';
|
||||
encode?: (val: string) => string;
|
||||
sameSite?: boolean | 'lax' | 'strict' | 'none';
|
||||
};
|
||||
genid?(req: express.Request): string;
|
||||
rolling?: boolean;
|
||||
resave?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user