Skip to content

Commit

Permalink
feat(password-reveal): set spellcheck attribute to false (#377)
Browse files Browse the repository at this point in the history
automatically set spellcheck attribute to false to protect
users' passwords from being sent to remote spellcheck services
  • Loading branch information
gregtyler committed Sep 20, 2022
1 parent 9880b1f commit 04a8ee1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/components/password-reveal.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ title: Password reveal

## When to use

Use the password reveal component to let users check their password safely.
Use the password reveal component to let users check their password safely.

This component automatically sets the `spellcheck` attribute to `false` to prevent users' passwords being stored in their browsers.
1 change: 1 addition & 0 deletions src/moj/components/password-reveal/password-reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ MOJFrontend.PasswordReveal = function(element) {
}

$el.data('moj-password-reveal-initialised', true);
$el.attr('spellcheck', 'false');

$el.wrap('<div class="moj-password-reveal"></div>');
this.container = $(this.el).parent();
Expand Down

0 comments on commit 04a8ee1

Please sign in to comment.