got a question about forms in React.js. I don't actually have an issue, but was wondering if there were any flaws in my approach.
I have a simple form, with two inputs for both email and password, like so:
<input
type="email"
name="email"
value={this.state.email}
onChange={this.handleChange}
data-message-required="Please enter your email address"
data-message-email="Please enter a VALID email address"
/>
and
<input
type="password"
name="password"
value={this.state.password}
onChange={this.handleChange}
data-minlength="3"
data-maxnlength="20"
data-message="Please enter your password"
/>
handleChange() is written as so:
handleChange = e => {
this.setState({
[e.target.name]:e.target.value
})}
My question is, is that are there any vulnerabilities in this code? When using React Dev Tools, I can track the components internal state, and the password appears as plaintext. I'm unsure if this means that it is possible for other sources to acquire the password through tracking the component's state.
Sorry if this question has been answered before, I did a quick search but could not find something that was specifically on this topic. Thanks for your time.