
(async function route() {
  try {
    const res = await fetch("modules/auth/me.php", {
      credentials: "include"
    });

    if (res.status === 401) {
      location.replace("login.html");
      return;
    }

    location.replace("dashboard.html");
  } catch {
    location.replace("login.html");
  }
})();
