diff --git a/.changeset/warm-dingos-battle.md b/.changeset/warm-dingos-battle.md new file mode 100644 index 00000000000..e90d74d4f72 --- /dev/null +++ b/.changeset/warm-dingos-battle.md @@ -0,0 +1,5 @@ +--- +"@wso2is/myaccount": patch +--- + +(fix) admin username not getting displaying properly in myaccount. diff --git a/apps/myaccount/src/components/shared/header.tsx b/apps/myaccount/src/components/shared/header.tsx index 46684b93e2b..9e3d9251dbc 100644 --- a/apps/myaccount/src/components/shared/header.tsx +++ b/apps/myaccount/src/components/shared/header.tsx @@ -267,7 +267,14 @@ export const Header: FunctionComponent = ( } if (profileInfo?.userName) { - return profileInfo.userName.split("/")[ 1 ]; + const userName: string = profileInfo.userName.split("/")[ 1 ]; + + // If the username is in TENANT/USERNAME format, return the USERNAME. + if (userName) { + return userName; + } + + return profileInfo.userName; } return "";