Hello H4xor

This commit is contained in:
Elizabeth Cray 2022-05-07 08:09:11 +00:00
parent e9bf9fd222
commit 54c9523f22
1 changed files with 14 additions and 6 deletions

View File

@ -1,8 +1,10 @@
const DEBUG = true; const DEBUG = false;
var isMobile = false; //initiate as false var isMobile = false; //initiate as false
const dbp = (msg) => { const dbp = (msg) => {
console.log(msg); if(DEBUG){
console.log(msg);
}
}; };
const SwalConfig = { const SwalConfig = {
@ -104,7 +106,7 @@ const generateSSH = async (name, id, token) => {
authToken: token authToken: token
}; };
$.post("https://tty.hackers.town/auth/setKey.php", payload, (response) => { $.post("https://tty.hackers.town/auth/setKey.php", payload, (response) => {
console.log(response); dbp(response);
// debugger; // debugger;
if(response.status){ if(response.status){
Swal.fire({ Swal.fire({
@ -119,10 +121,10 @@ const generateSSH = async (name, id, token) => {
}); });
} }
}).fail(() => { }).fail(() => {
console.log("Failed"); dbp("Failed");
}); });
}).catch((err) => { }).catch((err) => {
console.log(err); dbp(err);
}); });
} }
@ -153,7 +155,7 @@ const beginOauth = () => {
$.ajax({ $.ajax({
url: "https://tty.hackers.town/auth?act=id" url: "https://tty.hackers.town/auth?act=id"
}).then((data) => { }).then((data) => {
console.table(data); // console.table(data);
if(data.id){ if(data.id){
var redirect = "https://hackers.town/oauth/authorize?"+ var redirect = "https://hackers.town/oauth/authorize?"+
"response_type=code&client_id="+data.id+"&redirect_uri="+ "response_type=code&client_id="+data.id+"&redirect_uri="+
@ -185,12 +187,18 @@ $(() => {
disableNonDesktopElements(); disableNonDesktopElements();
} }
// Auto Retry // Auto Retry
var isRetry = false;
if(window.location.pathname.includes("auth")){ if(window.location.pathname.includes("auth")){
var ErrorMsg = document.getElementById("ErrorResult"); var ErrorMsg = document.getElementById("ErrorResult");
dbp(typeof ErrorMsg); dbp(typeof ErrorMsg);
if(typeof ErrorMsg !== 'undefined' && ErrorMsg.innerText.includes("Retry")){ if(typeof ErrorMsg !== 'undefined' && ErrorMsg.innerText.includes("Retry")){
dbp("attempt retry"); dbp("attempt retry");
isRetry = true;
beginOauth(); beginOauth();
} }
} }
// Console Welcome
if(!isRetry){
console.log("%cWelcome Hacker!", "color: #ff0000; font-size: 7em; font-style: italic; font-family: 'Times New Roman', Times, serif;");
}
}); });