diff --git a/backend/appdata/default.json b/backend/appdata/default.json index 526dd7f..d6b0753 100644 --- a/backend/appdata/default.json +++ b/backend/appdata/default.json @@ -50,6 +50,7 @@ "multi_user_mode": false, "allow_advanced_download": false, "use_cookies": false, + "jwt_expiration": 86400, "logger_level": "info" } } diff --git a/backend/appdata/encrypted.json b/backend/appdata/encrypted.json index 4113f4e..7b3ff45 100644 --- a/backend/appdata/encrypted.json +++ b/backend/appdata/encrypted.json @@ -50,6 +50,7 @@ "multi_user_mode": false, "allow_advanced_download": false, "use_cookies": false, + "jwt_expiration": 86400, "logger_level": "info" } } diff --git a/backend/authentication/auth.js b/backend/authentication/auth.js index d610826..78658ab 100644 --- a/backend/authentication/auth.js +++ b/backend/authentication/auth.js @@ -29,7 +29,7 @@ exports.initialize = function(input_users_db, input_logger) { ************************/ saltRounds = 10; - JWT_EXPIRATION = (60 * 60); // one hour + JWT_EXPIRATION = config_api.getConfigItem('ytdl_jwt_expiration'); SERVER_SECRET = null; if (users_db.get('jwt_secret').value()) { diff --git a/backend/config.js b/backend/config.js index 12e3bda..477e64b 100644 --- a/backend/config.js +++ b/backend/config.js @@ -227,6 +227,7 @@ DEFAULT_CONFIG = { "multi_user_mode": false, "allow_advanced_download": false, "use_cookies": false, + "jwt_expiration": 86400, "logger_level": "info" } } diff --git a/backend/consts.js b/backend/consts.js index 86b5dd8..81a9d61 100644 --- a/backend/consts.js +++ b/backend/consts.js @@ -152,6 +152,10 @@ let CONFIG_ITEMS = { 'key': 'ytdl_use_cookies', 'path': 'YoutubeDLMaterial.Advanced.use_cookies' }, + 'ytdl_jwt_expiration': { + 'key': 'ytdl_jwt_expiration', + 'path': 'YoutubeDLMaterial.Advanced.jwt_expiration' + }, 'ytdl_logger_level': { 'key': 'ytdl_logger_level', 'path': 'YoutubeDLMaterial.Advanced.logger_level' diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 684100a..5ada180 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -285,6 +285,18 @@ +