fix redirect bug for some accounts when disable create org is enabled

This commit is contained in:
miloschwartz
2025-07-18 12:59:57 -07:00
parent 23eb0da7d7
commit b34c3db956
5 changed files with 38 additions and 31 deletions

View File

@@ -41,35 +41,31 @@ export default function OrganizationLanding({
function getDescriptionText() {
if (organizations.length === 0) {
if (!disableCreateOrg) {
return t('componentsErrorNoMemberCreate');
return t("componentsErrorNoMemberCreate");
} else {
return t('componentsErrorNoMember');
return t("componentsErrorNoMember");
}
}
return t('componentsMember', {count: organizations.length});
return t("componentsMember", { count: organizations.length });
}
return (
<Card>
<CardHeader>
<CardTitle>{t('welcome')}</CardTitle>
<CardTitle>{t("welcome")}</CardTitle>
<CardDescription>{getDescriptionText()}</CardDescription>
</CardHeader>
<CardContent>
{organizations.length === 0 ? (
disableCreateOrg ? (
<p className="text-center text-muted-foreground">
t('componentsErrorNoMember')
</p>
) : (
!disableCreateOrg && (
<Link href="/setup">
<Button
className="w-full h-auto py-3 text-lg"
size="lg"
>
<Plus className="mr-2 h-5 w-5" />
{t('componentsCreateOrg')}
{t("componentsCreateOrg")}
</Button>
</Link>
)

View File

@@ -103,8 +103,10 @@ export default function SecurityKeyForm({
});
useEffect(() => {
loadSecurityKeys();
}, []);
if (open) {
loadSecurityKeys();
}
}, [open]);
const registerSchema = z.object({
name: z.string().min(1, { message: t("securityKeyNameRequired") }),