17 lines
331 B
JavaScript
17 lines
331 B
JavaScript
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 };
|
|
});
|