feat: add GitHub site initialization
This commit is contained in:
@@ -42,6 +42,10 @@ async function handleSaveSettings(request, response) {
|
||||
|
||||
settings.forEach((setting) => {
|
||||
if (!setting.key) return;
|
||||
const existing = db.prepare("SELECT encrypted FROM system_settings WHERE key = ?").get(String(setting.key));
|
||||
const shouldKeepExistingSecret = Boolean(existing?.encrypted) && Boolean(setting.encrypted) && !String(setting.value ?? "");
|
||||
if (shouldKeepExistingSecret) return;
|
||||
|
||||
setSetting(String(setting.key), String(setting.value ?? ""), Boolean(setting.encrypted));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user