Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: login form was disabled after 2nd failed login #22

Merged
merged 1 commit into from
Oct 12, 2020

Conversation

Haprog
Copy link
Contributor

@Haprog Haprog commented Oct 12, 2020

On submit the vaadin-login-form sets error to false and disabled to true. Then the disabled status is removed only if error is set to true (via observer _errorChanged(error)).

The issue was that Lit property bindings are one way so when login form sets its internal error status to false, our login-view still has error true (after first login failure) and when we try login for the second time then this.error = result.error; doesn't do anything because this.error is already true (in our view), so it doesn't change and it doesn't trigger the propagation of error true into login form component.

Fixes #21

On submit the `vaadin-login-form` sets `error` to `false` and `disabled` to `true`. Then the `disabled` status is removed only if `error` is set to `true` (via observer `_errorChanged(error)`).

The issue was that Lit property bindings are one way so when login form sets its internal error status to false, our `login-view` still has `error` `true` (after first login failure) and when we try login for the second time then `this.error = result.error;` doesn't do anything because `this.error` is already `true` (in our view), so it doesn't change and it doesn't trigger the propagation of `error` `true` into login form component.

Fixes #21
@haijian-vaadin haijian-vaadin merged commit 6cbc4cf into master Oct 12, 2020
@haijian-vaadin haijian-vaadin deleted the fix-login branch October 12, 2020 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Login view is disabled after after 2nd time of wrong credentials
2 participants