diff --git a/services/ui-src/package.json b/services/ui-src/package.json index e44d91c74..3415107c5 100644 --- a/services/ui-src/package.json +++ b/services/ui-src/package.json @@ -17,6 +17,7 @@ "aws-amplify": "^6.6.4", "date-fns": "^4.1.0", "font-awesome": "^4.7.0", + "js-cookie": "^3.0.5", "jsonpath": "^1.1.1", "launchdarkly-react-client-sdk": "^3.6.0", "mathjs": "^13.2.1", diff --git a/services/ui-src/src/hooks/authHooks/userProvider.jsx b/services/ui-src/src/hooks/authHooks/userProvider.jsx index 79a8ae863..d1daf5a5c 100644 --- a/services/ui-src/src/hooks/authHooks/userProvider.jsx +++ b/services/ui-src/src/hooks/authHooks/userProvider.jsx @@ -10,6 +10,7 @@ import { AppRoles, IdmRoles } from "../../types"; import { loadUser } from "../../actions/initial"; import { useDispatch } from "react-redux"; import config from "../../config"; +import Cookies from "js-cookie"; const cartsProdDomain = "https://mdctcarts.cms.gov"; const tempEndpoint = "https://dt4brcxdimpa0.cloudfront.net"; @@ -33,6 +34,7 @@ export const UserProvider = ({ children }) => { setUser(null); localStorage.clear(); sessionStorage.clear(); + Cookies.remove("cognito"); const url = `https://${config.cognito.APP_CLIENT_DOMAIN}/logout?client_id=${config.cognito.APP_CLIENT_ID}&logout_uri=${config.POST_SIGNOUT_REDIRECT}`; await signOut(); // eslint-disable-next-line no-console