mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-02 21:26:42 +01:00
23 lines
441 B
JavaScript
23 lines
441 B
JavaScript
|
import { defineStore } from 'pinia'
|
||
|
// import { useApi } from '@/api/useAPI.js'
|
||
|
|
||
|
// const api = useApi()
|
||
|
|
||
|
export const useUserStore = defineStore({
|
||
|
id: 'user',
|
||
|
|
||
|
state: () => {
|
||
|
return {
|
||
|
name: 'guest',
|
||
|
preferences: window.userPreferences,
|
||
|
isAdmin: false,
|
||
|
}
|
||
|
},
|
||
|
|
||
|
actions: {
|
||
|
updatePreference(preference) {
|
||
|
this.preferences = { ...this.state.preferences, ...preference }
|
||
|
},
|
||
|
},
|
||
|
})
|