mirror of
https://github.com/JonasunderscoreJones/Website-v1.git
synced 2025-10-28 03:49:19 +01:00
Add files via upload
This commit is contained in:
parent
75684c5f91
commit
4a1ac1b789
9 changed files with 338 additions and 1 deletions
20
login/js/auth.js
Normal file
20
login/js/auth.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class Auth {
|
||||
constructor() {
|
||||
document.querySelector("body").style.display = "none";
|
||||
const auth = localStorage.getItem("auth");
|
||||
this.validateAuth(auth);
|
||||
}
|
||||
|
||||
validateAuth(auth) {
|
||||
if (auth != 1) {
|
||||
window.location.replace("/");
|
||||
} else {
|
||||
document.querySelector("body").style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
logOut() {
|
||||
localStorage.removeItem("auth");
|
||||
window.location.replace("/");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue