export default defineNuxtRouteMiddleware(async (to, from) => {
  if (process.server) return;

  const { memberData, checkMemberStatus } = useAuth();

  if (!memberData.value) {
    const isAuthenticated = await checkMemberStatus();
    if (!isAuthenticated) {
      return navigateTo("/join");
    }
  }
});
