Skip to content

Commit

Permalink
rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuradhaSK committed May 17, 2024
1 parent 2dff61f commit 9d8657f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public boolean validateGrant(OAuthTokenReqMessageContext tokReqMsgCtx) throws Id

String token = extractParameter(OrganizationSwitchGrantConstants.Params.TOKEN_PARAM, tokReqMsgCtx);
String accessingOrgId = extractParameter(OrganizationSwitchGrantConstants.Params.ORG_PARAM, tokReqMsgCtx);
boolean isActiveOrg = isOrganizationActive(accessingOrgId);
boolean isActiveOrg = isActiveOrganization(accessingOrgId);
if (!isActiveOrg) {
throw new IdentityOAuth2ClientException(OAuth2ErrorCodes.INVALID_REQUEST,
"The switching organization is in deactivated state.");
Expand Down Expand Up @@ -144,15 +144,15 @@ public boolean validateGrant(OAuthTokenReqMessageContext tokReqMsgCtx) throws Id
return true;
}

private boolean isOrganizationActive(String organizationId) throws IdentityOAuth2Exception {
private boolean isActiveOrganization(String organizationId) throws IdentityOAuth2Exception {

String tenantDomainOfAccessingOrg = getTenantDomainFromOrgId(organizationId);
String tenantDomain = getTenantDomainFromOrgId(organizationId);
TenantManager tenantManager =
OrganizationSwitchGrantDataHolder.getInstance().getRealmService().getTenantManager();
try {
return tenantManager.isTenantActive(IdentityTenantUtil.getTenantId(tenantDomainOfAccessingOrg));
return tenantManager.isTenantActive(IdentityTenantUtil.getTenantId(tenantDomain));
} catch (UserStoreException e) {
throw new IdentityOAuth2Exception("Error while validating whether switching organization is active.", e);
throw new IdentityOAuth2Exception("Error while validating whether the organization is active.", e);
}
}

Expand Down

0 comments on commit 9d8657f

Please sign in to comment.