added auth guard
This commit is contained in:
7
src/scripts/auth-guard.js
Normal file
7
src/scripts/auth-guard.js
Normal file
@@ -0,0 +1,7 @@
|
||||
(function () {
|
||||
const token = localStorage.getItem("token");
|
||||
|
||||
if (!token && window.location.pathname !== "/") {
|
||||
window.location.href = "/";
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user