Fix ERR_TOO_MANY_REDIRECTS: hapus public/index.php dan tambah guard untuk prevent redirect loop
This commit is contained in:
@@ -75,7 +75,9 @@ async function handleLoginSubmit(event) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const form = document.getElementById('login-form');
|
||||
if (form) {
|
||||
if (Auth.isAuthenticated()) {
|
||||
// Cek apakah sudah authenticated dan belum di dashboard untuk menghindari redirect loop
|
||||
const currentPath = window.location.pathname;
|
||||
if (Auth.isAuthenticated() && !currentPath.includes('dashboard')) {
|
||||
window.location.href = 'dashboard.html';
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user