Skip to content

Commit 0b89afb

Browse files
Added security confirm dialog for installing unverified apps
1 parent 903421f commit 0b89afb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

client/pages/scripts/script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ fetch(((Object.keys(JSON.parse(fs.readFileSync(path.join(parent.process.resource
450450
appInstallButtonIcon.ariaHidden = true;
451451
appInstallButtonIcon.style.marginRight = "2px";
452452
appInstallButton.addEventListener("click", () => {
453+
if (!verified && !confirm("Are you sure you want install this unverified app possibly corrupting your computer?")) return;
453454
fetch(((Object.keys(JSON.parse(fs.readFileSync(path.join(parent.process.resourcesPath, "customServer.json"), "utf8"))).length) ? (JSON.parse(fs.readFileSync(path.join(parent.process.resourcesPath, "customServer.json"), "utf8")).resourceProtocol + "//" + JSON.parse(fs.readFileSync(path.join(parent.process.resourcesPath, "customServer.json"), "utf8")).resourceHostname + ((JSON.parse(fs.readFileSync(path.join(parent.process.resourcesPath, "customServer.json"), "utf8")).resourcePort) ? (":" + JSON.parse(fs.readFileSync(path.join(parent.process.resourcesPath, "customServer.json"), "utf8")).resourcePort) : "")) : (parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_PROTOCOL + "//" + parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_HOSTNAME + ((parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_PORT) ? (":" + parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_PORT) : ""))) + "/apps/code/" + appId + ".js")
454455
.then((response) => response.text())
455456
.then((appContent) => {

0 commit comments

Comments
 (0)