diff --git a/web/settings/account-settings.react.js b/web/settings/account-settings.react.js --- a/web/settings/account-settings.react.js +++ b/web/settings/account-settings.react.js @@ -5,6 +5,7 @@ import { logOut, logOutActionTypes } from 'lib/actions/user-actions'; import { useModalContext } from 'lib/components/modal-provider.react'; import { preRequestUserStateSelector } from 'lib/selectors/account-selectors'; +import { accountHasPassword } from 'lib/shared/account-utils.js'; import { useDispatchActionPromise, useServerCall, @@ -47,12 +48,31 @@ [popModal, pushModal], ); + const isAccountWithPassword = useSelector(state => + accountHasPassword(state.currentUserInfo), + ); + const currentUserInfo = useSelector(state => state.currentUserInfo); if (!currentUserInfo || currentUserInfo.anonymous) { return null; } const { username } = currentUserInfo; + let changePasswordSection; + if (isAccountWithPassword) { + changePasswordSection = ( +
Log out
-