mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 22:43:06 -04:00
make cookies more durable
This commit is contained in:
parent
e3f830697c
commit
8659b5410e
@ -7,6 +7,7 @@ import grant from "grant";
|
|||||||
import router from "./routes/user";
|
import router from "./routes/user";
|
||||||
import { loadSuml } from './loader';
|
import { loadSuml } from './loader';
|
||||||
import {isGranted} from "../src/helpers";
|
import {isGranted} from "../src/helpers";
|
||||||
|
import cookieSettings from "../src/cookieSettings";
|
||||||
|
|
||||||
global.config = loadSuml('config');
|
global.config = loadSuml('config');
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ app.use(express.urlencoded({ extended: true }));
|
|||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
app.use(session({
|
app.use(session({
|
||||||
secret: process.env.SECRET,
|
secret: process.env.SECRET,
|
||||||
cookie: {},
|
cookie: cookieSettings,
|
||||||
resave: false,
|
resave: false,
|
||||||
saveUninitialized: false,
|
saveUninitialized: false,
|
||||||
}));
|
}));
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
const inAYear = new Date();
|
||||||
|
inAYear.setFullYear(inAYear.getFullYear() + 1);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
maxAge: 365 * 24 * 60 * 60,
|
secure: process.env.NODE_ENV === 'production',
|
||||||
|
expires: inAYear,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user