Dev cleaning (#106)

This commit is contained in:
Munawwirul Jamal
2025-10-08 00:03:36 +07:00
committed by GitHub
parent 7fdd5c61f0
commit 3eb9dde21d
892 changed files with 51326 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
export const useUserStore = defineStore(
'user',
() => {
const user = ref<any | null>(null)
// const token = useCookie('authentication')
const isAuthenticated = computed(() => !!user.value)
// const userRole = computed(() => user.value?.user_position_code || '')
const login = async (userData: any) => {
user.value = userData
}
const logout = () => {
user.value = null
}
return {
user,
isAuthenticated,
userRole: ['doctor'],
login,
logout,
}
},
{
persist: {
key: 'user',
pick: ['user'],
},
},
)