mirror of https://github.com/coddrago/Heroku
Remove heroku support from web
parent
041960117f
commit
c5e7cff689
|
@ -28,8 +28,6 @@
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.button:hover {
|
.button:hover {
|
||||||
box-shadow: inset 5px 5px 3px rgba(255, 255, 255, .1),
|
box-shadow: inset 5px 5px 3px rgba(255, 255, 255, .1),
|
||||||
inset -5px -5px 3px rgba(255, 255, 255, .1);
|
inset -5px -5px 3px rgba(255, 255, 255, .1);
|
||||||
|
@ -71,7 +69,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
/*background: linear-gradient(-45deg, #007700 0%, #004400 100%);*/
|
|
||||||
transition: all 2s ease;
|
transition: all 2s ease;
|
||||||
background: #16181d;
|
background: #16181d;
|
||||||
}
|
}
|
||||||
|
@ -303,24 +300,24 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="blur">
|
<div class="blur">
|
||||||
<div class="title">Hikka</div>
|
<div class="title">Hikka</div>
|
||||||
<div class="description">Ultimate userbot.<br>Best <span style="color:#28a0dc">Telegram</span> userbot.<br><b>Ever</b>.</div>
|
<div class="description">Fresh and cute<br><span style="color:#28a0dc">Telegram</span> userbot.</div>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<div class="button" id="get_started">Get started</div>
|
<div class="button" id="get_started">Get started</div>
|
||||||
<span id="block_api_id">
|
<span id="block_api_id">
|
||||||
<label class="api_id" for="api_id">API ID: </label>
|
<label class="api_id" for="api_id">Telegram API ID: </label>
|
||||||
<input class="api_id" id="api_id" placeholder="2020" style="width: 4em;">
|
<input class="api_id" id="api_id" placeholder="xxxx" style="width: 4em;">
|
||||||
</span>
|
</span>
|
||||||
<span id="block_api_hash">
|
<span id="block_api_hash">
|
||||||
<label class="api_hash" for="api_hash">API HASH: </label>
|
<label class="api_hash" for="api_hash">Telegram API hash: </label>
|
||||||
<input class="api_hash" id="api_hash" placeholder="w7i07l02i6hymgg03ncq6esmr3t4c9kl" style="width: 24em;">
|
<input class="api_hash" id="api_hash" placeholder="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" style="width: 24em;">
|
||||||
</span>
|
</span>
|
||||||
<span id="block_phone">
|
<span id="block_phone">
|
||||||
<label class="phone" for="phone">Phone: </label>
|
<label class="phone" for="phone">Phone: </label>
|
||||||
<input class="phone" id="phone" placeholder="+79999999999" style="width: 12em;">
|
<input class="phone" id="phone" placeholder="xxxxxxxxxxx" style="width: 12em;">
|
||||||
</span>
|
</span>
|
||||||
<span id="block_2fa">
|
<span id="block_2fa">
|
||||||
<label class="_2fa" for="_2fa">2FA Password: </label>
|
<label class="_2fa" for="_2fa">2FA Password: </label>
|
||||||
<input class="_2fa" id="_2fa" placeholder="passw0rd" style="width: 12em;" type="password">
|
<input class="_2fa" id="_2fa" placeholder="password" style="width: 12em;" type="password">
|
||||||
</span>
|
</span>
|
||||||
<div id="continue_btn">Continue</div>
|
<div id="continue_btn">Continue</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -354,16 +351,20 @@
|
||||||
return phoneRe.test(p);
|
return phoneRe.test(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
var _api_id = "", _api_hash = "", _phone = "", _2fa_pass = "", _tg_pass = "";
|
var _api_id = "",
|
||||||
|
_api_hash = "",
|
||||||
|
_phone = "",
|
||||||
|
_2fa_pass = "",
|
||||||
|
_tg_pass = "";
|
||||||
|
|
||||||
const cnt_btn = document.querySelector('#continue_btn');
|
const cnt_btn = document.querySelector('#continue_btn');
|
||||||
cnt_btn.onclick = (e) => {
|
cnt_btn.onclick = (e) => {
|
||||||
if(cnt_btn.disabled) return;
|
if (cnt_btn.disabled) return;
|
||||||
|
|
||||||
let step = cnt_btn.getAttribute('current-step');
|
let step = cnt_btn.getAttribute('current-step');
|
||||||
if(step == "api_id") {
|
if (step == "api_id") {
|
||||||
let api_id = document.querySelector('#api_id').value;
|
let api_id = document.querySelector('#api_id').value;
|
||||||
if(api_id.length < 4 || !isInt(api_id)) {
|
if (api_id.length < 4 || !isInt(api_id)) {
|
||||||
$(".bg").addClass("red_state");
|
$(".bg").addClass("red_state");
|
||||||
cnt_btn.disabled = true;
|
cnt_btn.disabled = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -380,7 +381,7 @@
|
||||||
});
|
});
|
||||||
} else if (step == "api_hash") {
|
} else if (step == "api_hash") {
|
||||||
let api_hash = document.querySelector('#api_hash').value;
|
let api_hash = document.querySelector('#api_hash').value;
|
||||||
if(api_hash.length != 32) {
|
if (api_hash.length != 32) {
|
||||||
$(".bg").addClass("red_state");
|
$(".bg").addClass("red_state");
|
||||||
cnt_btn.disabled = true;
|
cnt_btn.disabled = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -396,7 +397,7 @@
|
||||||
body: _api_hash + _api_id,
|
body: _api_hash + _api_id,
|
||||||
credentials: "include"
|
credentials: "include"
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
|
@ -409,16 +410,16 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (response) {
|
.catch(function(response) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
'title': 'Error occured while saving credentials'
|
'title': 'Error occured while saving credentials'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (step == "phone" || step == "2fa") {
|
} else if (step == "phone" || step == "2fa") {
|
||||||
if(step == "phone") {
|
if (step == "phone") {
|
||||||
let phone = document.querySelector('#phone').value;
|
let phone = document.querySelector('#phone').value;
|
||||||
if(!isValidPhone(phone)) {
|
if (!isValidPhone(phone)) {
|
||||||
$(".bg").addClass("red_state");
|
$(".bg").addClass("red_state");
|
||||||
cnt_btn.disabled = true;
|
cnt_btn.disabled = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -429,8 +430,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
_phone = phone;
|
_phone = phone;
|
||||||
fetch("/sendTgCode", {method: "POST", body: _phone, credentials: "include"})
|
fetch("/sendTgCode", {
|
||||||
.then(function (response) {
|
method: "POST",
|
||||||
|
body: _phone,
|
||||||
|
credentials: "include"
|
||||||
|
})
|
||||||
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
|
@ -448,7 +453,10 @@
|
||||||
showLoaderOnConfirm: true,
|
showLoaderOnConfirm: true,
|
||||||
preConfirm: (login) => {
|
preConfirm: (login) => {
|
||||||
_tg_pass = login
|
_tg_pass = login
|
||||||
return fetch("/tgCode", {method: "POST", body: _tg_pass + "\n" + _phone + "\n" + _2fa_pass})
|
return fetch("/tgCode", {
|
||||||
|
method: "POST",
|
||||||
|
body: _tg_pass + "\n" + _phone + "\n" + _2fa_pass
|
||||||
|
})
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
@ -466,19 +474,12 @@
|
||||||
Swal.showValidationMessage('Internal server error');
|
Swal.showValidationMessage('Internal server error');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Swal.fire({
|
return fetch("/finishLogin", {
|
||||||
title: 'Enter Heroku token',
|
method: "POST",
|
||||||
text: 'Leave empty to NOT install to Heroku',
|
body: heroku_token,
|
||||||
input: 'text',
|
credentials: "include"
|
||||||
inputAttributes: {
|
})
|
||||||
autocapitalize: 'off'
|
.then(function(response) {
|
||||||
},
|
|
||||||
showCancelButton: false,
|
|
||||||
confirmButtonText: 'Confirm',
|
|
||||||
showLoaderOnConfirm: true,
|
|
||||||
preConfirm: (heroku_token) => {
|
|
||||||
return fetch("/finishLogin", {method: "POST", body: heroku_token, credentials: "include"})
|
|
||||||
.then(function (response) {
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
|
@ -495,15 +496,12 @@
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (response) {
|
.catch(function(response) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
'text': 'Login confirmation error'
|
'text': 'Login confirmation error'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
},
|
|
||||||
allowOutsideClick: () => !Swal.isLoading()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -516,7 +514,7 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function(error) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
'title': 'Code send failed'
|
'title': 'Code send failed'
|
||||||
|
@ -525,7 +523,10 @@
|
||||||
} else {
|
} else {
|
||||||
let _2fa = document.querySelector('#_2fa').value;
|
let _2fa = document.querySelector('#_2fa').value;
|
||||||
_2fa_pass = _2fa;
|
_2fa_pass = _2fa;
|
||||||
fetch("/tgCode", {method: "POST", body: _tg_pass + "\n" + _phone + "\n" + _2fa_pass})
|
fetch("/tgCode", {
|
||||||
|
method: "POST",
|
||||||
|
body: _tg_pass + "\n" + _phone + "\n" + _2fa_pass
|
||||||
|
})
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
@ -543,9 +544,12 @@
|
||||||
Swal.showValidationMessage('Internal server error');
|
Swal.showValidationMessage('Internal server error');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
{% if hosting %}
|
fetch("/finishLogin", {
|
||||||
fetch("/finishLogin", {method: "POST", body: '', credentials: "include"})
|
method: "POST",
|
||||||
.then(function (response) {
|
body: '',
|
||||||
|
credentials: "include"
|
||||||
|
})
|
||||||
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
|
@ -562,52 +566,12 @@
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (response) {
|
.catch(function(response) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
'icon': 'error',
|
'icon': 'error',
|
||||||
'text': 'Login confirmation error'
|
'text': 'Login confirmation error'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
{% else %}
|
|
||||||
Swal.fire({
|
|
||||||
title: 'Enter Heroku token',
|
|
||||||
text: 'Leave empty to NOT install to Heroku',
|
|
||||||
input: 'text',
|
|
||||||
inputAttributes: {
|
|
||||||
autocapitalize: 'off'
|
|
||||||
},
|
|
||||||
showCancelButton: false,
|
|
||||||
confirmButtonText: 'Confirm',
|
|
||||||
showLoaderOnConfirm: true,
|
|
||||||
preConfirm: (heroku_token) => {
|
|
||||||
return fetch("/finishLogin", {method: "POST", body: heroku_token, credentials: "include"})
|
|
||||||
.then(function (response) {
|
|
||||||
if (!response.ok) {
|
|
||||||
Swal.fire({
|
|
||||||
'icon': 'error',
|
|
||||||
'text': 'Login confirmation error'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
Swal.fire({
|
|
||||||
'icon': 'success',
|
|
||||||
'text': 'Auth successful!',
|
|
||||||
'timer': 1000
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
window.location.reload();
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(function (response) {
|
|
||||||
Swal.fire({
|
|
||||||
'icon': 'error',
|
|
||||||
'text': 'Login confirmation error'
|
|
||||||
})
|
|
||||||
});
|
|
||||||
},
|
|
||||||
allowOutsideClick: () => !Swal.isLoading()
|
|
||||||
})
|
|
||||||
{% endif %}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
Loading…
Reference in New Issue