Skip to content

Commit

Permalink
feat: automatic login when password is autofilled by the browser (chr…
Browse files Browse the repository at this point in the history
  • Loading branch information
rando128 authored Dec 5, 2022
1 parent 577229d commit f7444d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/js/LockScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class LockScreen extends React.Component {

this.handleFormSubmit = this.handleFormSubmit.bind(this);
this.handlePasswordChange = this.handlePasswordChange.bind(this);
this.handlePasswordAutofill = this.handlePasswordAutofill.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -67,6 +68,10 @@ class LockScreen extends React.Component {
});
}

handlePasswordAutofill(e) {
this.handleFormSubmit(e)
}

render() {
const { loading } = this.state;

Expand Down Expand Up @@ -101,6 +106,7 @@ class LockScreen extends React.Component {
placeholder='Enter your password'
required
onChange={this.handlePasswordChange}
onBlur={this.handlePasswordAutofill}
/>

<InputGroup.Append>
Expand Down

0 comments on commit f7444d4

Please sign in to comment.