Added option to change JWT expiration time called "Login expiration" in the Advanced tab

This commit is contained in:
Isaac Abadi
2020-08-10 14:26:59 -04:00
parent 690871f6b2
commit c9b615c659
7 changed files with 21 additions and 1 deletions

View File

@@ -50,6 +50,7 @@
"multi_user_mode": false,
"allow_advanced_download": false,
"use_cookies": false,
"jwt_expiration": 86400,
"logger_level": "info"
}
}

View File

@@ -50,6 +50,7 @@
"multi_user_mode": false,
"allow_advanced_download": false,
"use_cookies": false,
"jwt_expiration": 86400,
"logger_level": "info"
}
}

View File

@@ -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()) {

View File

@@ -227,6 +227,7 @@ DEFAULT_CONFIG = {
"multi_user_mode": false,
"allow_advanced_download": false,
"use_cookies": false,
"jwt_expiration": 86400,
"logger_level": "info"
}
}

View File

@@ -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'

View File

@@ -285,6 +285,18 @@
</mat-select>
</mat-form-field>
</div>
<div class="col-12 mt-2 mb-1">
<mat-form-field>
<mat-label><ng-container i18n="Login expiration select label">Login expiration</ng-container></mat-label>
<mat-select color="accent" [(ngModel)]="new_config['Advanced']['jwt_expiration']">
<mat-option [value]="3600">1 Hour</mat-option>
<mat-option [value]="86400">1 Day</mat-option>
<mat-option [value]="604800">1 Week</mat-option>
<mat-option [value]="2592000">1 Month</mat-option>
<mat-option [value]="31536000">1 Year</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Advanced']['allow_advanced_download']"><ng-container i18n="Allow advanced downloading setting">Allow advanced download</ng-container></mat-checkbox>
</div>

View File

@@ -50,6 +50,7 @@
"custom_downloading_agent": "",
"multi_user_mode": true,
"allow_advanced_download": true,
"jwt_expiration": 86400,
"logger_level": "debug",
"use_cookies": true
}