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

feat: Ensure password inputs are masked when switching type #1170

Merged
merged 3 commits into from
Mar 20, 2023

Conversation

mydea
Copy link
Contributor

@mydea mydea commented Mar 8, 2023

This PR improves masking of <input type="password"> elements in the case that their type is switched to text. This is quite common in modern UI, where often you have a button to "show password" while typing it. We should still mask this content in that case as if it was a password, in order to prevent accidentally capturing this unmasked.

This is done by adding an data-rr-is-password attribute to the input in the case where the type is changed from password to something else.

Note: While at it, I also changed the code to actually accommodate uppercase type, as e.g. <input type="PASSWORD"> is valid but would not have been masked previously, as we never converted the type to lowercase.

@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2023

🦋 Changeset detected

Latest commit: 2869161

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
rrweb-snapshot Minor
rrweb Minor
rrdom Minor
rrdom-nodejs Minor
rrweb-player Minor
@rrweb/types Minor
@rrweb/web-extension Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Apply formatting changes

use data- attribute


ref: Ensure type is always lowercased


add changeset
@mydea mydea force-pushed the fn/handle-password-type-change branch from 22757c8 to 40be43a Compare March 20, 2023 09:59
Copy link
Member

@YunFeng0817 YunFeng0817 left a comment

Choose a reason for hiding this comment

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

Thank you!

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.

2 participants