17 lines
331 B
JavaScript
Raw Normal View History

2025-02-08 15:27:48 +08:00
import { ref } from 'vue';
import { defineStore } from 'pinia';
export const useAuthStore = defineStore('auth', () => {
const isAuthenticated = ref(false);
function login() {
isAuthenticated.value = true;
}
function logout() {
isAuthenticated.value = false;
}
return { isAuthenticated, login, logout };
});