Skip to content

Commit e78192b

Browse files
Merge pull request wso2#8065 from AfraHussaindeen/resend-code-api-userstore-domain-name-fix
Extract user store domain from username and if not found default to primary store in handleResendCode
2 parents 1723f47 + a6297d1 commit e78192b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@wso2is/admin.users.v1": patch
3+
"@wso2is/console": patch
4+
---
5+
6+
Extract user store domain from username and if not found default to primary store in handleResendCode

features/admin.users.v1/components/user-profile.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { TenantInfo } from "@wso2is/admin.tenants.v1/models/tenant";
4646
import { getAssociationType } from "@wso2is/admin.tenants.v1/utils/tenants";
4747
import { ProfileConstants } from "@wso2is/core/constants";
4848
import { IdentityAppsApiException } from "@wso2is/core/exceptions";
49-
import { getUserNameWithoutDomain } from "@wso2is/core/helpers";
49+
import { getUserNameWithoutDomain, resolveUserstore } from "@wso2is/core/helpers";
5050
import {
5151
AlertInterface,
5252
AlertLevels,
@@ -218,6 +218,8 @@ export const UserProfile: FunctionComponent<UserProfilePropsInterface> = (
218218
);
219219
const userSchemaURI: string = useSelector((state: AppState) => state?.config?.ui?.userSchemaURI);
220220
const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state.config.ui.features);
221+
const primaryUserStoreDomainName: string = useSelector((state: AppState) =>
222+
state?.config?.ui?.primaryUserStoreDomainName);
221223

222224
const hasUsersUpdatePermissions: boolean = useRequiredScopes(
223225
featureConfig?.users?.scopes?.update
@@ -2801,6 +2803,7 @@ export const UserProfile: FunctionComponent<UserProfilePropsInterface> = (
28012803
setIsSubmitting(true);
28022804

28032805
const resolvedUsername: string = getUserNameWithoutDomain(user?.userName);
2806+
const userStoreDomain: string = resolveUserstore(user?.userName, primaryUserStoreDomainName);
28042807

28052808
const requestData: ResendCodeRequestData = {
28062809
properties: [
@@ -2810,7 +2813,7 @@ export const UserProfile: FunctionComponent<UserProfilePropsInterface> = (
28102813
}
28112814
],
28122815
user: {
2813-
realm: user[ SCIMConfigs.scim.systemSchema ]?.userSource,
2816+
realm: userStoreDomain,
28142817
username: resolvedUsername
28152818
}
28162819
};

0 commit comments

Comments
 (0)