mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
Fix: No orgs selectable if a user has been removed from an organization
This commit is contained in:
@@ -121,6 +121,14 @@ export default function LoginPage() {
|
|||||||
}
|
}
|
||||||
}, [router]);
|
}, [router]);
|
||||||
|
|
||||||
|
// Case: User has no organizations.
|
||||||
|
// This can happen if the user was previously a member, but the organization was deleted or the user was removed.
|
||||||
|
useEffect(() => {
|
||||||
|
if (!organizations.isLoading && organizations.data?.length === 0) {
|
||||||
|
router.push("/org/none");
|
||||||
|
}
|
||||||
|
}, [organizations.isLoading, organizations.data]);
|
||||||
|
|
||||||
if (userLoading || !user) {
|
if (userLoading || !user) {
|
||||||
return <LoadingScreen />;
|
return <LoadingScreen />;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user