Skip to content

Commit

Permalink
Fixed the issue with setup not showing up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Scholer committed Jan 22, 2019
1 parent 31b6a49 commit afe4489
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

//Click on the "Purdue Account Login" button
if (window.location.href.startsWith("https://mycourses.purdue.edu/webapps/login/") === true
if (window.location.href.startsWith("https://mycourses.purdue.edu/webapps/login/") === true
&& document.getElementsByClassName("purdue-btn-bottom-row")[0] !== null) {
document.getElementsByClassName("purdue-btn-bottom-row")[0].click();
}
Expand Down Expand Up @@ -60,6 +60,15 @@ if (window.location.href.startsWith("https://www.purdue.edu/apps/account/cas/log
//Get the user's info to setup a new BoilerKey
askForInfo();
}
} else {
//If we don't have activation data, remove the info currently stored, as it needs to be replaced.
localStorage.removeItem("pin");
localStorage.removeItem("code");
localStorage.removeItem("username");
localStorage.removeItem("count");
localStorage.removeItem("hotpSecret");
//Get the user's info to setup a new BoilerKey
askForInfo();
}
}

Expand All @@ -78,11 +87,11 @@ async function askForInfo() {
}
}

hotpSecret = await makeRequest("POST", 'https://api-1b9bef70.duosecurity.com/push/v2/activation/' +
code + '?app_id=com.duosecurity.duomobile.app.DMApplication' +
'&app_version=2.3.3&app_build_number=323206&full_disk_encryption=false&manufacturer=Google&model=Pixel&' +
'platform=Android&jailbroken=false&version=6.0&language=EN&customer_protocol=1');
hotpSecret = await makeRequest("POST", 'https://api-1b9bef70.duosecurity.com/push/v2/activation/' +
code + '?app_id=com.duosecurity.duomobile.app.DMApplication' +
'&app_version=2.3.3&app_build_number=323206&full_disk_encryption=false&manufacturer=Google&model=Pixel&' +
'platform=Android&jailbroken=false&version=6.0&language=EN&customer_protocol=1');

hotpSecret = JSON.parse(hotpSecret);
hotpSecret = hotpSecret.response["hotp_secret"];

Expand Down

0 comments on commit afe4489

Please sign in to comment.