Skip to content

Commit

Permalink
Fix idp domain being dropped when checking for existing user.
Browse files Browse the repository at this point in the history
  • Loading branch information
RushanNanayakkara committed Feb 12, 2024
1 parent 2087dc9 commit 969c336
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1287,13 +1287,13 @@ public boolean isUsernameAlreadyTaken(String username, String tenantDomain) thro

if (StringUtils.isBlank(tenantDomain)) {
tenantDomain = MultitenantUtils.getTenantDomain(username);
// If tenant domain is not provided, tenant domain is derived from the username.
username = MultitenantUtils.getTenantAwareUsername(username);
}
try {
String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(username);

UserRealm userRealm = getUserRealm(tenantDomain);
if (userRealm != null) {
isUsernameAlreadyTaken = userRealm.getUserStoreManager().isExistingUser(tenantAwareUsername) ||
isUsernameAlreadyTaken = userRealm.getUserStoreManager().isExistingUser(username) ||
hasPendingAddUserWorkflow(username, tenantDomain);
}
} catch (CarbonException | org.wso2.carbon.user.core.UserStoreException e) {
Expand Down

0 comments on commit 969c336

Please sign in to comment.