Skip to content

Commit

Permalink
Redirected the user if he tries to go on the login page while already…
Browse files Browse the repository at this point in the history
… logged in
  • Loading branch information
Oliviier-dev committed Mar 18, 2024
1 parent ec0a4a0 commit 323aa72
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UI/Javascript/login-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
}

if(window.location.pathname.includes("login.html") || window.location.pathname.includes("signup.html")) {
// Check if user has admin JWT
var tokenCookie = getCookie('jwt');
if (tokenCookie) {
window.location.href = "../../index.html"; // Redirect to home page
}
}



Expand Down

0 comments on commit 323aa72

Please sign in to comment.