import { defineStore } from 'pinia';
import { getAuthValid } from '@/api/auth/auth';
import { ref } from 'vue';

export const useAuthStore = defineStore('auth', () => {
  const isAuthValid = ref(true);

  const checkAuthValid = () => {
    return getAuthValid().then((res) => {
      isAuthValid.value = res;
    });
  };

  return { isAuthValid, checkAuthValid };
});

export default useAuthStore;
