diff --git a/content.js b/content.js index 4a06692..33c467e 100644 --- a/content.js +++ b/content.js @@ -91,23 +91,25 @@ window.password_prompt = function (label_message, button_message, arg3, arg4, ar //Click on the "Purdue West Lafayette" button window.addEventListener("load", redirectCAS, false); +let url = new URL(window.location.href); +let reset = url.searchParams.get("reset") === "true"; + //Make sure we're on Purdue's CAS, otherwise, don't do anything. if (window.location.href.startsWith("https://www.purdue.edu/apps/account/cas/login") === true) { - let url = new URL(window.location.href); - let reset = url.searchParams.get("reset"); - if (reset === "true") { - alert("Reset time!"); - localStorage.removeItem("pin"); - localStorage.removeItem("code"); - localStorage.removeItem("hotpSecret"); - localStorage.removeItem("username"); - localStorage.removeItem("counter"); + if (reset) { + if (confirm("Are you sure you want to reset BoilerKey Helper?")) { + localStorage.removeItem("pin"); + localStorage.removeItem("code"); + localStorage.removeItem("hotpSecret"); + localStorage.removeItem("username"); + localStorage.removeItem("counter"); + } window.close(); } } //Make sure we're on Purdue's CAS, otherwise, don't do anything. -if (window.location.href.startsWith("https://www.purdue.edu/apps/account/cas/login") === true) { +if (window.location.href.startsWith("https://www.purdue.edu/apps/account/cas/login") && !reset) { //Retrieve everything from localStorage. let pin, code, hotpSecret, username; pin = get("pin"); diff --git a/manifest.json b/manifest.json index c946db7..01aa9ee 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "BoilerKey Helper", "description": "An extension that alleviates Purdue's BoilerKey two-factor authentication.", "author": "The Purdue Community", - "version": "1.8.1", + "version": "1.9.0", "icons": { "16": "icons/icon16.png", "48": "icons/icon48.png", @@ -27,7 +27,8 @@ }, "browser_action": { "default_icon": "icons/icon128.png", - "default_title": "BoilerKey Helper" + "default_title": "BoilerKey Helper", + "default_popup": "popup.html" }, "permissions": [ "https://api-1b9bef70.duosecurity.com/"