diff --git a/web/components/log-out-if-missing-csat-handler.react.js b/web/components/log-out-if-missing-csat-handler.react.js --- a/web/components/log-out-if-missing-csat-handler.react.js +++ b/web/components/log-out-if-missing-csat-handler.react.js @@ -4,6 +4,7 @@ import { logOutActionTypes, useLogOut } from 'lib/actions/user-actions.js'; import { useModalContext } from 'lib/components/modal-provider.react.js'; +import { accountHasPassword } from 'lib/shared/account-utils.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { useSelector } from 'lib/utils/redux-utils.js'; import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js'; @@ -11,30 +12,46 @@ import css from './version-handler.css'; import Modal from '../modals/modal.react.js'; -function MissingCSATModal(): React.Node { +type Props = { + +isAccountWithPassword: boolean, +}; + +function MissingCSATModal(props: Props): React.Node { const { popModal } = useModalContext(); + const { isAccountWithPassword } = props; + + let modalContent; + if (isAccountWithPassword) { + modalContent = ( +

+ Unfortunately, we must log you out in order to generate a PAKE-derived + secret. You can learn more about PAKEs and the protocol we use (OPAQUE){' '} + + here + + . +

+ ); + } else { + modalContent = ( +

+ Unfortunately, we must log you out as we perform an update to our + system. +

+ ); + } return ( -
-

- Unfortunately, we must log you out in order to generate a PAKE-derived - secret. You can learn more about PAKEs and the protocol we use - (OPAQUE){' '} - - here - - . -

-
+
{modalContent}
); } @@ -42,6 +59,9 @@ function LogOutIfMissingCSATHandler() { const dispatchActionPromise = useDispatchActionPromise(); const callLogOut = useLogOut(); + const isAccountWithPassword = useSelector(state => + accountHasPassword(state.currentUserInfo), + ); const hasAccessToken = useSelector(state => !!state.commServicesAccessToken); const dataLoaded = useSelector(state => state.dataLoaded); @@ -51,13 +71,16 @@ React.useEffect(() => { if (!hasAccessToken && dataLoaded && usingCommServicesAccessToken) { void dispatchActionPromise(logOutActionTypes, callLogOut()); - pushModal(); + pushModal( + , + ); } }, [ callLogOut, dataLoaded, dispatchActionPromise, hasAccessToken, + isAccountWithPassword, pushModal, ]); }