forked from baron/baron-sso
tenants 명칭 및 profile 전화번호 추가
This commit is contained in:
@@ -650,8 +650,8 @@ function ClientGeneralPage() {
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "tenant",
|
||||
description: t("msg.dev.clients.scopes.tenant", "소속 테넌트 정보 접근"),
|
||||
name: "tenants",
|
||||
description: t("msg.dev.clients.scopes.tenants", "소속 테넌트 정보 접근"),
|
||||
mandatory: false,
|
||||
},
|
||||
{
|
||||
@@ -675,14 +675,14 @@ function ClientGeneralPage() {
|
||||
);
|
||||
|
||||
const tenantScopeDescription = t(
|
||||
"msg.dev.clients.scopes.tenant",
|
||||
"msg.dev.clients.scopes.tenants",
|
||||
"소속 테넌트 정보 접근",
|
||||
);
|
||||
|
||||
const buildTenantScope = useCallback(
|
||||
(id: string): ScopeItem => ({
|
||||
id,
|
||||
name: "tenant",
|
||||
name: "tenants",
|
||||
description: tenantScopeDescription,
|
||||
mandatory: true,
|
||||
locked: true,
|
||||
@@ -693,12 +693,15 @@ function ClientGeneralPage() {
|
||||
const normalizeScopesForTenantAccess = useCallback(
|
||||
(nextScopes: ScopeItem[], restricted: boolean): ScopeItem[] => {
|
||||
const normalized = nextScopes.map((scope) => {
|
||||
if (scope.name.trim() !== "tenant") {
|
||||
const scopeName = scope.name.trim();
|
||||
if (scopeName !== "tenants" && scopeName !== "tenant") {
|
||||
return scope;
|
||||
}
|
||||
const canonicalName = "tenants";
|
||||
if (restricted) {
|
||||
return {
|
||||
...scope,
|
||||
name: canonicalName,
|
||||
description: scope.description || tenantScopeDescription,
|
||||
mandatory: true,
|
||||
locked: true,
|
||||
@@ -706,6 +709,7 @@ function ClientGeneralPage() {
|
||||
}
|
||||
return {
|
||||
...scope,
|
||||
name: canonicalName,
|
||||
description: scope.description || tenantScopeDescription,
|
||||
locked: false,
|
||||
};
|
||||
@@ -713,20 +717,23 @@ function ClientGeneralPage() {
|
||||
|
||||
if (
|
||||
restricted &&
|
||||
!normalized.some((scope) => scope.name.trim() === "tenant")
|
||||
!normalized.some(
|
||||
(scope) => scope.name.trim() === "tenants" || scope.name.trim() === "tenant",
|
||||
)
|
||||
) {
|
||||
normalized.push(buildTenantScope(`tenant-${Date.now()}`));
|
||||
normalized.push(buildTenantScope(`tenants-${Date.now()}`));
|
||||
}
|
||||
|
||||
const openidScopes = normalized.filter(
|
||||
(scope) => scope.name.trim() === "openid",
|
||||
);
|
||||
const tenantScopes = normalized.filter(
|
||||
(scope) => scope.name.trim() === "tenant",
|
||||
(scope) =>
|
||||
scope.name.trim() === "tenants" || scope.name.trim() === "tenant",
|
||||
);
|
||||
const remainingScopes = normalized.filter((scope) => {
|
||||
const name = scope.name.trim();
|
||||
return name !== "openid" && name !== "tenant";
|
||||
return name !== "openid" && name !== "tenants" && name !== "tenant";
|
||||
});
|
||||
|
||||
return [...openidScopes, ...tenantScopes, ...remainingScopes];
|
||||
@@ -762,7 +769,7 @@ function ClientGeneralPage() {
|
||||
},
|
||||
{
|
||||
id: "standard-tenant",
|
||||
name: "tenant",
|
||||
name: "tenants",
|
||||
description: tenantScopeDescription,
|
||||
source: "standard",
|
||||
},
|
||||
@@ -2389,7 +2396,7 @@ function ClientGeneralPage() {
|
||||
<p className="leading-relaxed">
|
||||
{t(
|
||||
"ui.dev.clients.general.tenant_access.hint",
|
||||
"제한을 켜면 tenant 스코프가 자동으로 포함되며, 허용 테넌트를 하나 이상 선택해야 합니다.",
|
||||
"제한을 켜면 tenants 스코프가 자동으로 포함되며, 허용 테넌트를 하나 이상 선택해야 합니다.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user