ff-admin/src/stores/account.ts

26 lines
642 B
TypeScript
Raw Normal View History

2024-08-23 14:42:32 +02:00
import { defineStore } from "pinia";
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) {
this.firstname = firstname;
this.lastname = lastname;
this.mail = mail;
this.alias = alias;
},
},
});