parse-dashboard 5.1.0-alpha.3 → 5.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -54,14 +54,13 @@ function initialize(app, options) {
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
var cookieSessionSecret = options.cookieSessionSecret || require('crypto').randomBytes(64).toString('hex');
|
|
57
|
+
const cookieSessionMaxAge = options.cookieSessionMaxAge;
|
|
57
58
|
app.use(require('connect-flash')());
|
|
58
59
|
app.use(require('body-parser').urlencoded({ extended: true }));
|
|
59
60
|
app.use(require('cookie-session')({
|
|
60
61
|
key : 'parse_dash',
|
|
61
62
|
secret : cookieSessionSecret,
|
|
62
|
-
|
|
63
|
-
maxAge: (2 * 7 * 24 * 60 * 60 * 1000) // 2 weeks
|
|
64
|
-
}
|
|
63
|
+
maxAge : cookieSessionMaxAge
|
|
65
64
|
}));
|
|
66
65
|
app.use(passport.initialize());
|
|
67
66
|
app.use(passport.session());
|
package/Parse-Dashboard/app.js
CHANGED
|
@@ -68,7 +68,7 @@ module.exports = function(config, options) {
|
|
|
68
68
|
const users = config.users;
|
|
69
69
|
const useEncryptedPasswords = config.useEncryptedPasswords ? true : false;
|
|
70
70
|
const authInstance = new Authentication(users, useEncryptedPasswords, mountPath);
|
|
71
|
-
authInstance.initialize(app, { cookieSessionSecret: options.cookieSessionSecret });
|
|
71
|
+
authInstance.initialize(app, { cookieSessionSecret: options.cookieSessionSecret, cookieSessionMaxAge: options.cookieSessionMaxAge });
|
|
72
72
|
|
|
73
73
|
// CSRF error handler
|
|
74
74
|
app.use(function (err, req, res, next) {
|
package/Parse-Dashboard/index.js
CHANGED
|
@@ -28,6 +28,8 @@ program.option('--trustProxy [trustProxy]', 'set this flag when you are behind a
|
|
|
28
28
|
program.option('--cookieSessionSecret [cookieSessionSecret]', 'set the cookie session secret, defaults to a random string. You should set that value if you want sessions to work across multiple server, or across restarts');
|
|
29
29
|
program.option('--createUser', 'helper tool to allow you to generate secure user passwords and secrets. Use this on trusted devices only.');
|
|
30
30
|
program.option('--createMFA', 'helper tool to allow you to generate multi-factor authentication secrets.');
|
|
31
|
+
program.option('--cookieSessionMaxAge [cookieSessionMaxAge]', '(Optional) Sets the time in seconds for when the session cookie will be deleted and the dashboard user has to re-login; if no value is set then the cookie will be deleted when the browser session ends.');
|
|
32
|
+
|
|
31
33
|
program.action(async (options) => {
|
|
32
34
|
for (const key in options) {
|
|
33
35
|
const func = CLIHelper[key];
|