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

Add support for custom password change forms #2383

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

varjolintu
Copy link
Member

Refactors kpxcForm for handling pages where possible change password forms are not actually form elements, but three different input fields, and the submit button might not even be related to the same container.

If the new kpxcForm.initCustomForm() detects three different password fields and there's a form submit button exception found in kpxcSites, the fields are stored temporarily and the extension listens for the submit button click.

Refactors kpxcForm.onSubmit() to have multiple smaller functions that the new onCustomFormSubmit() can also use:

  • activateCredentialBanner() handles the form field results and activates the Credential Banner. Originall this code was at the end of onSubmit().
  • getUsernameValue() returns the username value from selected input field or from retrieved credentials. Originally this code was at the middle of onSubmit().

Fixes an issue mentioned in: #1358 (comment)

Copy link
Member

@droidmonkey droidmonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, why is "3 the magic number" on password fields?

@varjolintu
Copy link
Member Author

Looks good, why is "3 the magic number" on password fields?

Three default fields: current password, new password, repeat new password. Actually, I should change that to >= 2 just in case, because the getNewPassword() already works that way.

@droidmonkey
Copy link
Member

Gtg

@varjolintu varjolintu merged commit ef2225f into develop Nov 11, 2024
@varjolintu varjolintu deleted the feature/custom_password_form branch November 11, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants