major: Migration from better-auth to keycloak
This commit is contained in:
17
legalconsenthub/stores/useUserStore.ts
Normal file
17
legalconsenthub/stores/useUserStore.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { Organization } from '~/types/keycloak'
|
||||
|
||||
export const useUserStore = defineStore('Organization', () => {
|
||||
const { user } = useUserSession()
|
||||
const selectedOrganization = computed<Organization | null>(() => {
|
||||
if (!user.value?.organizations || user.value.organizations.length === 0) {
|
||||
return null
|
||||
}
|
||||
return user.value.organizations[0]
|
||||
})
|
||||
|
||||
return {
|
||||
user: user.value,
|
||||
organizations: user.value?.organizations,
|
||||
selectedOrganization
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user