Cookie Auth

This commit is contained in:
TheEmeraldStarr 2020-10-03 20:43:11 -07:00
parent 4fc085e547
commit 7b2eb1e645
4 changed files with 22 additions and 10 deletions

View file

@ -138,6 +138,7 @@
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/bs-init.js"></script>
<script src="expr/bp.js "></script>
<script src="expr/auth.js "></script>
</body>
</html>

View file

@ -138,6 +138,7 @@
<script src="assets/bootstrap/js/bootstrap.min.js "></script>
<script src="assets/js/bs-init.js "></script>
<script src="expr/bp.js "></script>
<script src="expr/auth.js "></script>
</body>
</html>

View file

@ -1,9 +1,25 @@
function $(id) {
return document.getElementById(id);
};
$('nprox').onclick = function nu() {
document.cookie = 'auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
}
$('al').onclick = function nu() {
document.cookie = 'auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
}
$('pmprox').onclick = function nu() {
document.cookie = 'auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
}
$('pdprox').onclick = function nu() {
document.cookie = 'auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
}
var host = location.hostname.split('.');
var auth = location.hostname;
if (host.length == 3) {
auth = `${host[1]}.${host[2]}`;
}
function nu() {
document.cookie = 'auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
}

View file

@ -29,12 +29,6 @@ $('pmprox').onclick = function() {
return false;
};
// AL Auth
$('al').onclick = function() {
document.cookie = 'al_auth=yes; expires=' + (Date.now() + 259200) + '; sameSite=none; domain=.' + auth + '; path=/; secure;';
return false;
};
// Cookie Auth
var host = location.hostname.split('.');
var auth = location.hostname;