diff --git a/services/ui-src/src/containers/PackageList.js b/services/ui-src/src/containers/PackageList.js index 0c7a377e4..fc23ff21d 100644 --- a/services/ui-src/src/containers/PackageList.js +++ b/services/ui-src/src/containers/PackageList.js @@ -218,7 +218,7 @@ const PackageList = () => { ({ value, row }) => ( {value} diff --git a/services/ui-src/src/containers/UserManagement.js b/services/ui-src/src/containers/UserManagement.js index 1cba6f28b..328e63ca7 100644 --- a/services/ui-src/src/containers/UserManagement.js +++ b/services/ui-src/src/containers/UserManagement.js @@ -166,7 +166,7 @@ const UserManagement = () => { ({ value, row }) => ( {value} diff --git a/services/ui-src/src/containers/UserPage.js b/services/ui-src/src/containers/UserPage.js index 011497c34..fff126682 100644 --- a/services/ui-src/src/containers/UserPage.js +++ b/services/ui-src/src/containers/UserPage.js @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useMemo, useState } from "react"; -import { useLocation, useParams, useHistory } from "react-router-dom"; +import { useLocation, useParams } from "react-router-dom"; import { Button, Review } from "@cmsgov/design-system"; import { @@ -157,7 +157,6 @@ export const GroupDivisionDisplay = ({ profileData = {} }) => { * Component housing data belonging to a particular user */ const UserPage = () => { - const history = useHistory(); const { userProfile, setUserInfo, updatePhoneNumber, userRole, userStatus } = useAppContext(); const location = useLocation(); @@ -175,10 +174,10 @@ const UserPage = () => { const [isEditingPhone, setIsEditingPhone] = useState(false); const isReadOnly = location.pathname !== ROUTES.PROFILE && - decodeURIComponent(userId) !== window.btoa(userProfile.email); + decodeURIComponent(userId) !== userProfile.email; useEffect(() => { - const getProfile = async (encodedProfileEmail) => { + const getProfile = async (profileEmail) => { if (!isReadOnly) { return [{ ...userProfile.userData }, userRole, userStatus]; } @@ -188,7 +187,6 @@ const UserPage = () => { tempProfileStatus = "status"; try { - const profileEmail = window.atob(encodedProfileEmail); tempProfileData = await UserDataApi.userProfile(profileEmail); const profileAccess = effectiveRoleForUser(tempProfileData?.roleList); if (profileAccess !== null) @@ -196,8 +194,6 @@ const UserPage = () => { } catch (e) { console.error("Error fetching user data", e); setAlertCode(RESPONSE_CODE[e.message]); - // redirect if the user is not found - history.push("/notfound"); } return [tempProfileData, tempProfileRole, tempProfileStatus]; @@ -213,7 +209,7 @@ const UserPage = () => { console.error("Error fetching user data", e); setAlertCode(RESPONSE_CODE[e.message]); }); - }, [isReadOnly, userId, userProfile, userRole, userStatus, history]); + }, [isReadOnly, userId, userProfile, userRole, userStatus]); const onPhoneNumberCancel = useCallback(() => { setIsEditingPhone(false);