Fix ERR_TOO_MANY_REDIRECTS: hapus public/index.php dan tambah guard untuk prevent redirect loop
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user