Skip to content

Commit d5b95cb

Browse files
authored
fix(organizations): move organization better-auth client to conditionally be included based on FF (#2367)
* fix(organizations): move organization better-auth client to conditionally be included based on FF * ack PR comment
1 parent 0fb084b commit d5b95cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/sim/lib/auth/auth-client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export const client = createAuthClient({
2525
stripeClient({
2626
subscription: true, // Enable subscription management
2727
}),
28+
organizationClient(),
2829
]
2930
: []),
30-
organizationClient(),
3131
...(env.NEXT_PUBLIC_SSO_ENABLED ? [ssoClient()] : []),
3232
],
3333
})
@@ -42,7 +42,9 @@ export function useSession(): SessionHookResult {
4242
return ctx
4343
}
4444

45-
export const { useActiveOrganization } = client
45+
export const useActiveOrganization = isBillingEnabled
46+
? client.useActiveOrganization
47+
: () => ({ data: undefined, isPending: false, error: null })
4648

4749
export const useSubscription = () => {
4850
return {

0 commit comments

Comments
 (0)