mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-19 07:42:43 +00:00
chore: skip the conditional org switch for better auth state share (#533)
This commit is contained in:
parent
b3aab91489
commit
6a47cd9763
1 changed files with 9 additions and 8 deletions
|
|
@ -39,14 +39,15 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
|||
useEffect(() => {
|
||||
if (session?.session.activeOrganizationId) {
|
||||
authClient.organization.getFullOrganization().then((org) => {
|
||||
if (org.metadata?.isConsumer === true) {
|
||||
setOrg(org)
|
||||
} else {
|
||||
const consumerOrg = orgs?.find((o) => o.metadata?.isConsumer === true)
|
||||
if (consumerOrg) {
|
||||
setActiveOrg(consumerOrg.slug)
|
||||
}
|
||||
}
|
||||
// TODO: Uncomment this when we have a way to handle consumer organizations better way
|
||||
//if (org.metadata?.isConsumer === true) {
|
||||
setOrg(org)
|
||||
//} else {
|
||||
// const consumerOrg = orgs?.find((o) => o.metadata?.isConsumer === true)
|
||||
// if (consumerOrg) {
|
||||
// setActiveOrg(consumerOrg.slug)
|
||||
// }
|
||||
//}
|
||||
})
|
||||
}
|
||||
}, [session?.session.activeOrganizationId, orgs])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue