ff-admin/src/stores/account.ts

28 lines
752 B
TypeScript
Raw Normal View History

2024-08-23 14:42:32 +02:00
import { defineStore } from "pinia";
2024-09-17 16:44:02 +02:00
import type { PermissionObject } from "@/types/permissionTypes";
import { useAbilityStore } from "./ability";
2024-08-23 14:42:32 +02:00
export const useAccountStore = defineStore("account", {
state: () => {
return {
firstname: "" as string,
lastname: "" as string,
mail: "" as string,
alias: "" as string,
};
},
actions: {
logoutAccount() {
localStorage.removeItem("accessToken");
localStorage.removeItem("refreshToken");
window.open("/login", "_self");
},
setAccountData(firstname: string, lastname: string, mail: string, alias: string) {
2024-08-23 14:42:32 +02:00
this.firstname = firstname;
this.lastname = lastname;
this.mail = mail;
this.alias = alias;
},
},
});