Fix ERR_TOO_MANY_REDIRECTS: hapus public/index.php dan tambah guard untuk prevent redirect loop

This commit is contained in:
mwpn
2025-12-18 11:34:20 +07:00
parent 90d0d1a761
commit 28ddcc71ff
6 changed files with 17 additions and 9 deletions

View File

@@ -69,7 +69,9 @@
window.Auth = Auth;
// Jika sudah login, langsung arahkan ke dashboard utama (public/dashboard)
if (Auth.isAuthenticated()) {
// Cek dulu apakah kita sudah di dashboard untuk menghindari redirect loop
const currentPath = window.location.pathname;
if (Auth.isAuthenticated() && !currentPath.includes('dashboard.html')) {
window.location.href = 'public/dashboard/dashboard.html';
}