show error message on bad password attempts

This commit is contained in:
Sean Yesmunt 2019-10-29 15:26:03 -04:00
parent 31d4f9614c
commit 98ce02508c
5 changed files with 24 additions and 7 deletions

View file

@ -128,7 +128,7 @@
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#e5440ba86078dcdfced490bc444810c8f57dc774", "lbry-redux": "lbryio/lbry-redux#e5440ba86078dcdfced490bc444810c8f57dc774",
"lbryinc": "lbryio/lbryinc#980c938310791365615662da2924107128109e4c", "lbryinc": "lbryio/lbryinc#f962cdf31a4c36f7bdb8b71fc403a3377d58a460",
"lint-staged": "^7.0.2", "lint-staged": "^7.0.2",
"localforage": "^1.7.1", "localforage": "^1.7.1",
"lodash-es": "^4.17.14", "lodash-es": "^4.17.14",

View file

@ -1,5 +1,5 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { doGetSync, selectGetSyncIsPending, selectUserEmail } from 'lbryinc'; import { doGetSync, selectGetSyncIsPending, selectUserEmail, selectSyncApplyPasswordError } from 'lbryinc';
import { doSetClientSetting } from 'redux/actions/settings'; import { doSetClientSetting } from 'redux/actions/settings';
import { doSignOut } from 'redux/actions/app'; import { doSignOut } from 'redux/actions/app';
import SyncPassword from './view'; import SyncPassword from './view';
@ -7,6 +7,7 @@ import SyncPassword from './view';
const select = state => ({ const select = state => ({
getSyncIsPending: selectGetSyncIsPending(state), getSyncIsPending: selectGetSyncIsPending(state),
email: selectUserEmail(state), email: selectUserEmail(state),
passwordError: selectSyncApplyPasswordError(state),
}); });
const perform = dispatch => ({ const perform = dispatch => ({

View file

@ -11,11 +11,12 @@ type Props = {
getSync: (?string) => void, getSync: (?string) => void,
getSyncIsPending: boolean, getSyncIsPending: boolean,
email: string, email: string,
passwordError: boolean,
signOut: () => void, signOut: () => void,
}; };
function SyncPassword(props: Props) { function SyncPassword(props: Props) {
const { getSync, getSyncIsPending, email, signOut } = props; const { getSync, getSyncIsPending, email, signOut, passwordError } = props;
const [password, setPassword] = React.useState(''); const [password, setPassword] = React.useState('');
const [rememberPassword, setRememberPassword] = usePersistedState(true); const [rememberPassword, setRememberPassword] = usePersistedState(true);
@ -35,6 +36,7 @@ function SyncPassword(props: Props) {
<div> <div>
<FormField <FormField
type="password" type="password"
error={passwordError && __('Wrong password for %email%', { email })}
label={__('Password for %email%', { email })} label={__('Password for %email%', { email })}
value={password} value={password}
onChange={e => setPassword(e.target.value)} onChange={e => setPassword(e.target.value)}

View file

@ -829,5 +829,19 @@
"An email address is required to sync your account.": "An email address is required to sync your account.", "An email address is required to sync your account.": "An email address is required to sync your account.",
"Sign Out": "Sign Out", "Sign Out": "Sign Out",
"Follow more tags": "Follow more tags", "Follow more tags": "Follow more tags",
"Portuguese": "Portuguese" "Portuguese": "Portuguese",
} "Sign In to LBRY": "Sign In to LBRY",
"Check Your Email": "Check Your Email",
"sign in": "sign in",
"An email was sent to %email%. Follow the link to %verify_text%. This will update automatically.": "An email was sent to %email%. Follow the link to %verify_text%. This will update automatically.",
"Resend Email": "Resend Email",
"Sync your balance and preferences across devices.": "Sync your balance and preferences across devices.",
"Add Email": "Add Email",
"New email sent.": "New email sent.",
"Enter Your Wallet Password": "Enter Your Wallet Password",
"You set your wallet password when you previously installed LBRY. This may have been on different device.": "You set your wallet password when you previously installed LBRY. This may have been on different device.",
"Password for %email%": "Password for %email%",
"help guide": "help guide",
"If you are having issues, checkout our %help% or email us at %email%.": "If you are having issues, checkout our %help% or email us at %email%.",
"Wrong password for %email%": "Wrong password for %email%"
}

View file

@ -6851,9 +6851,9 @@ lbry-redux@lbryio/lbry-redux#e5440ba86078dcdfced490bc444810c8f57dc774:
reselect "^3.0.0" reselect "^3.0.0"
uuid "^3.3.2" uuid "^3.3.2"
lbryinc@lbryio/lbryinc#980c938310791365615662da2924107128109e4c: lbryinc@lbryio/lbryinc#f962cdf31a4c36f7bdb8b71fc403a3377d58a460:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/980c938310791365615662da2924107128109e4c" resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/f962cdf31a4c36f7bdb8b71fc403a3377d58a460"
dependencies: dependencies:
reselect "^3.0.0" reselect "^3.0.0"