Cookie Auth

This commit is contained in:
TheEmeraldStarr 2020-10-03 20:24:46 -07:00
parent 01c94f39d4
commit c639877531
2 changed files with 16 additions and 25 deletions

View file

@ -75,36 +75,27 @@
</script>
<div class="d-flex align-items-center order-12" style="height:200px;">
<div class="container border rounded text-center justify-content-center align-items-center button" style="color: rgb(255,255,255);filter: blur(0px); opacity: 0.95;">
<form onkeydown="nu()">
<form>
<p style=" font-size: 46px; ">Node Unblocker</p>
<p style="font-family: 'Montserrat Alternates', sans-serif; ">A flexible secondary proxy compared to Alloy, PM and PD.</p>
<div class="input-group ">
<div class="input-group-prepend"></div><input id="url" class="bg-dark border rounded-0 border-info shadow-sm form-control form-control-lg " type="text" name="url" style="width: 194px;font-family:
'Montserrat Alternates', sans-serif;opacity: 0.80; color:rgb(255,255,255); " placeholder="Insert URL ">
<div class="input-group-append "><button id="nprox" class="btn btn-dark btn-lg bg-dark border rounded-0 border-info shadow-lg select " data-bs-hover-animate="pulse " name="button" type="submit " style="width: 78px;padding: 8px;margin:
<div class="input-group-append "><button id="auth" class="btn btn-dark btn-lg bg-dark border rounded-0 border-info shadow-lg select " data-bs-hover-animate="pulse " name="button" type="submit " style="width: 78px;padding: 8px;margin:
0px;height: 46.126px;font-family: 'Montserrat Alternates', sans-serif;font-size: 16px; ">Go</button></div>
</div>
<div>
<!-- Cookie Auth-->
<script>
function setCookie(name, value) {
document.cookie = name + '=' + encodeURIComponent(value) + '; expires=' + date + '; SameSite=None; Secure';
}
function readCookie(name) {
var cookie = document.cookie.split('; ');
var cookies = {};
for (var i = 0; i < cookie.length; i++) {
var cur = cookie[i].split('=');
cookies[cur[0]] = cur[1];
}
return decodeURIComponent(cookies[name]);
}
/* Login Cookie*/
function Login(value) {
User(value);
setCookie('session', value);
var btns = header.getElementsByClassName("auth");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
if (current.length > 0) {
current[0].className = current[0].className.replace(" active", "");
}
this.className += " active";
});
}
</script>
</div>

View file

@ -8,23 +8,23 @@ function $(id) {
$('nprox').onclick = function() {
document.cookie = 'nu_auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
return false;
return true;
};
$('pdprox').onclick = function() {
document.cookie = 'pd_auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
return false;
return true;
};
$('pmprox').onclick = function() {
document.cookie = 'pm_auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
return false;
return true;
};
// AL Auth
$('al').onclick = function() {
document.cookie = 'al_auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
return false;
return true;
};
// Cookie Auth
@ -34,7 +34,7 @@ if (host.length == 3) {
auth = `${host[1]}.${host[2]}`;
}
Array.from(document.getElementsByTagName('button')).forEach(e => {
Array.from(document.getElementById('auth')).forEach(e => {
e.addEventListener('click', () => {
document.cookie = 'session; max-age=259200; sameSite=lax; domain=' + auth + '; path=/; secure;';
});