Removed pin setting functionality

- Simplifies security options: use multi user mode if you want to restrict access to the settings menu
This commit is contained in:
Isaac Grynsztein
2020-07-09 22:33:07 -04:00
parent 14bd82c508
commit dd80c51f16
11 changed files with 1 additions and 246 deletions

View File

@@ -96,7 +96,6 @@ db.defaults(
configWriteFlag: false,
downloads: {},
subscriptions: [],
pin_md5: '',
files_to_db_migration_complete: false
}).write();
@@ -2623,49 +2622,6 @@ app.post('/api/updateServer', async (req, res) => {
});
// Pin API calls
app.post('/api/isPinSet', async (req, res) => {
let stored_pin = db.get('pin_md5').value();
let is_set = false;
if (!stored_pin || stored_pin.length === 0) {
} else {
is_set = true;
}
res.send({
is_set: is_set
});
});
app.post('/api/setPin', async (req, res) => {
let unhashed_pin = req.body.pin;
let hashed_pin = md5(unhashed_pin);
db.set('pin_md5', hashed_pin).write();
res.send({
success: true
});
});
app.post('/api/checkPin', async (req, res) => {
let input_pin = req.body.input_pin;
let input_pin_md5 = md5(input_pin);
let stored_pin = db.get('pin_md5').value();
let successful = false;
if (input_pin_md5 === stored_pin) {
successful = true;
}
res.send({
success: successful
});
});
// API Key API calls
app.post('/api/generateNewAPIKey', function (req, res) {

View File

@@ -66,10 +66,6 @@ let CONFIG_ITEMS = {
'key': 'ytdl_allow_multi_download_mode',
'path': 'YoutubeDLMaterial.Extra.allow_multi_download_mode'
},
'ytdl_settings_pin_required': {
'key': 'ytdl_settings_pin_required',
'path': 'YoutubeDLMaterial.Extra.settings_pin_required'
},
'ytdl_enable_downloads_manager': {
'key': 'ytdl_enable_downloads_manager',
'path': 'YoutubeDLMaterial.Extra.enable_downloads_manager'