Page MenuHomePhabricator

D11860.diff
No OneTemporary

D11860.diff

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 = (
+ <p>
+ 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){' '}
+ <a
+ href="https://blog.cryptographyengineering.com/2018/10/19/lets-talk-about-pake/"
+ target="_blank"
+ rel="noreferrer"
+ >
+ here
+ </a>
+ .
+ </p>
+ );
+ } else {
+ modalContent = (
+ <p>
+ Unfortunately, we must log you out as we perform an update to our
+ system.
+ </p>
+ );
+ }
return (
<Modal
- name="We&rsquo;re improving our password security"
+ name="We&rsquo;re improving our security"
onClose={popModal}
size="large"
>
- <div className={css.modalContent}>
- <p>
- 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){' '}
- <a
- href="https://blog.cryptographyengineering.com/2018/10/19/lets-talk-about-pake/"
- target="_blank"
- rel="noreferrer"
- >
- here
- </a>
- .
- </p>
- </div>
+ <div className={css.modalContent}>{modalContent}</div>
</Modal>
);
}
@@ -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(<MissingCSATModal />);
+ pushModal(
+ <MissingCSATModal isAccountWithPassword={isAccountWithPassword} />,
+ );
}
}, [
callLogOut,
dataLoaded,
dispatchActionPromise,
hasAccessToken,
+ isAccountWithPassword,
pushModal,
]);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 4:24 AM (21 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2536699
Default Alt Text
D11860.diff (3 KB)

Event Timeline