more stores

This commit is contained in:
2026-01-22 15:49:34 +00:00
parent b1c69df4cb
commit a081549f2d
10 changed files with 262 additions and 116 deletions
+6 -4
View File
@@ -4,10 +4,10 @@ import axios from "axios";
export const useAuthStore = defineStore("auth", () => {
const user = ref({});
checkToken();
const loggedIn = computed(() => !!user.value.username);
checkToken();
async function logOut() {
try {
const res = await axios.post("/api/auth/logout");
@@ -61,11 +61,13 @@ export const useAuthStore = defineStore("auth", () => {
return {
user,
checkToken,
loggedIn,
logIn,
checkToken,
refreshToken,
logOut,
createUser,
loggedIn,
};
});