Line data Source code
1 : import type { ComputedRef } from 'vue'
2 : import { computed } from 'vue'
3 :
4 : import { useCurrentUser } from '@/composables/auth/useCurrentUser'
5 : import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
6 :
7 2445 : export function useBillingIdentity(): ComputedRef<string> {
8 2445 : const { resolvedUserInfo } = useCurrentUser()
9 2445 : const teamWorkspaceStore = useTeamWorkspaceStore()
10 2445 : return computed(
11 : () =>
12 : `${resolvedUserInfo.value?.id ?? 'anonymous'}:${teamWorkspaceStore.workspaceId ?? 'none'}`
13 : )
14 : }
|