forked from baron/baron-sso
custom claim 권한체크 확인
This commit is contained in:
@@ -59,6 +59,19 @@ import { ClientLogo } from "./components/ClientLogo";
|
||||
type ClientSortKey = "application" | "id" | "type" | "status" | "createdAt";
|
||||
const clientListPreviewCount = 5;
|
||||
|
||||
function isClientTenantLimited(client: ClientSummary) {
|
||||
const metadata = client.metadata ?? {};
|
||||
if (metadata.tenant_access_restricted === true) {
|
||||
return true;
|
||||
}
|
||||
if (!Array.isArray(metadata.allowed_tenants)) {
|
||||
return false;
|
||||
}
|
||||
return metadata.allowed_tenants.some(
|
||||
(tenantId) => typeof tenantId === "string" && tenantId.trim() !== "",
|
||||
);
|
||||
}
|
||||
|
||||
function ClientsPage() {
|
||||
const navigate = useNavigate();
|
||||
const auth = useAuth();
|
||||
@@ -529,14 +542,16 @@ function ClientsPage() {
|
||||
{client.name ||
|
||||
t("ui.dev.clients.untitled", "Untitled")}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
<span aria-hidden="true">
|
||||
{t(
|
||||
"ui.dev.clients.tenant_scoped",
|
||||
"Tenant-scoped",
|
||||
)}
|
||||
</span>
|
||||
</p>
|
||||
{isClientTenantLimited(client) && (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
<span aria-hidden="true">
|
||||
{t(
|
||||
"ui.dev.clients.tenant_limited",
|
||||
"Tenant-limited",
|
||||
)}
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</Link>
|
||||
</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user