<template>
  <div></div>
</template>

<script lang="ts" setup>
  import { useRouter } from 'vue-router';
  import useSilenceAuth from '@/hooks/silence-auth';

  const router = useRouter();

  const { silenceAuthorityHandle } = useSilenceAuth();

  async function checkSilenceAuth() {
    const url = await window.electron.checkSilenceAuthority();
    window.api.logger(`wait checkSilenceAuth: ${url}`);
    if (!url) {
      router.push({ name: 'Login' });
      return;
    }

    silenceAuthorityHandle(url);
  }
  checkSilenceAuth();
</script>
