Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit d203441

Browse files
authored
Merge pull request #1769 from blockchain/philip/WEB-9-second-password-user-is-logged-out-after
fix(Second PW): preventDefault on form submission
2 parents feceb08 + 28d6b9e commit d203441

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

packages/blockchain-wallet-v4-frontend/src/modals/Settings/SecondPassword/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import React from 'react'
22
import { connect } from 'react-redux'
33
import { bindActionCreators, compose } from 'redux'
4+
45
import { actions, selectors } from 'data'
6+
import { Types } from 'blockchain-wallet-v4'
7+
58
import modalEnhancer from 'providers/ModalEnhancer'
69
import SecondPassword from './template.js'
7-
import { Types } from 'blockchain-wallet-v4'
810
import * as C from 'services/AlertService'
911

1012
class SecondPasswordContainer extends React.PureComponent {
1113
state = { secondPassword: '' }
1214

13-
handleSubmit = () => {
15+
handleSubmit = e => {
16+
e.preventDefault()
1417
if (
1518
Types.Wallet.isValidSecondPwd(
1619
this.state.secondPassword,

packages/blockchain-wallet-v4-frontend/src/modals/Settings/SecondPassword/template.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3+
import { reduxForm } from 'redux-form'
34
import { FormattedMessage } from 'react-intl'
45

56
import {
@@ -12,14 +13,15 @@ import {
1213
PasswordInput,
1314
Text
1415
} from 'blockchain-info-components'
16+
import { Form } from 'components/Form'
1517

1618
const SecondPassword = props => {
1719
const { position, total, close, ...rest } = props
1820
const { handleSubmit, handleChange, value } = rest
1921

2022
return (
2123
<Modal size='medium' position={position} total={total} closeButton={false}>
22-
<form onSubmit={handleSubmit}>
24+
<Form onSubmit={handleSubmit}>
2325
<ModalHeader icon='safe' onClose={close}>
2426
<FormattedMessage
2527
id='modals.secondpassword.title'
@@ -63,7 +65,7 @@ const SecondPassword = props => {
6365
/>
6466
</Button>
6567
</ModalFooter>
66-
</form>
68+
</Form>
6769
</Modal>
6870
)
6971
}
@@ -73,4 +75,4 @@ SecondPassword.propTypes = {
7375
handleSubmit: PropTypes.func.isRequired
7476
}
7577

76-
export default SecondPassword
78+
export default reduxForm({ form: 'secondPassword' })(SecondPassword)

0 commit comments

Comments
 (0)