remove current password requirement so you can change pw after recovery
This commit is contained in:
@@ -19,8 +19,8 @@ const addState = connect(
|
||||
} = state;
|
||||
|
||||
|
||||
function sendSetPassword(current, password) {
|
||||
postData('/account/password', { current, password })
|
||||
function sendSetPassword(password) {
|
||||
postData('/account/password', { password })
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (data.error) return errorToast(data.error);
|
||||
@@ -74,7 +74,7 @@ class AccountStatus extends Component {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
passwordState: { current: '', password: '', confirm: ''},
|
||||
passwordState: { password: '', confirm: ''},
|
||||
emailState: null,
|
||||
unsubState: false,
|
||||
};
|
||||
@@ -105,8 +105,8 @@ class AccountStatus extends Component {
|
||||
passwordState.password === passwordState.confirm;
|
||||
|
||||
const setPasswordDisabled = () => {
|
||||
const { current, password, confirm } = passwordState;
|
||||
return !(passwordsEqual() && password && current && confirm);
|
||||
const { password, confirm } = passwordState;
|
||||
return !(passwordsEqual() && password && confirm);
|
||||
}
|
||||
|
||||
const tlClick = e => {
|
||||
@@ -173,15 +173,7 @@ class AccountStatus extends Component {
|
||||
</div>
|
||||
<div>
|
||||
<h3>Password</h3>
|
||||
<label for="current">Password:</label>
|
||||
<input
|
||||
class="login-input"
|
||||
type="password"
|
||||
name="current"
|
||||
value={passwordState.current}
|
||||
onInput={linkState(this, 'passwordState.current')}
|
||||
placeholder="current"
|
||||
/>
|
||||
<label for="current">Set Password:</label>
|
||||
<input
|
||||
class="login-input"
|
||||
type="password"
|
||||
@@ -202,7 +194,7 @@ class AccountStatus extends Component {
|
||||
/>
|
||||
<button
|
||||
disabled={setPasswordDisabled()}
|
||||
onClick={() => sendSetPassword(passwordState.current, passwordState.password)}>
|
||||
onClick={() => sendSetPassword(passwordState.password)}>
|
||||
Set Password
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user