Skip to content

Commit

Permalink
Merge pull request wso2#5783 from Yasasr1/fix-org-check
Browse files Browse the repository at this point in the history
Remove legacyAuthzRuntime check when transforming tenantDomain
  • Loading branch information
Yasasr1 authored Mar 20, 2024
2 parents 2a0c086 + 5abcece commit dc2f525
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-tips-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/console": patch
---

Remove legacyAuthzRuntime check when transforming tenantDomain
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

import { useContext } from "react";
import useAuthorization from "../../authorization/hooks/use-authorization";
import { MultitenantConstants } from "../../core/constants/multitenant-constants";
import useAppSettings from "../../core/hooks/use-app-settings";
import OrganizationsContext, { OrganizationsContextProps } from "../context/organizations-context";
Expand Down Expand Up @@ -73,8 +72,6 @@ export interface UseOrganizationsInterface extends OrganizationsContextProps {
const useOrganizations = (): UseOrganizationsInterface => {
const context: OrganizationsContextProps = useContext(OrganizationsContext);

const { legacyAuthzRuntime } = useAuthorization();

const { getLocalStorageSetting, setLocalStorageSetting, removeLocalStorageSetting } = useAppSettings();

if (context === undefined) {
Expand All @@ -89,10 +86,8 @@ const useOrganizations = (): UseOrganizationsInterface => {
*/
const transformTenantDomain = (tenantDomain: string): string => {
// With the latest Authz framework, `carbon.super` is resolved as `Super`.
if (!legacyAuthzRuntime) {
if (tenantDomain === MultitenantConstants.SUPER_TENANT_DISPLAY_NAME) {
return MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
}
if (tenantDomain === MultitenantConstants.SUPER_TENANT_DISPLAY_NAME) {
return MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
}

return tenantDomain;
Expand Down

0 comments on commit dc2f525

Please sign in to comment.