[Web] Generate longer passwords for app passwords

This commit is contained in:
andryyy
2019-12-07 21:55:37 +01:00
parent eb350d48c0
commit 0c8d9ff154
2 changed files with 7 additions and 2 deletions

View File

@@ -15,7 +15,12 @@ $(document).ready(function() {
$(".generate_password").click(function( event ) {
event.preventDefault();
$('[data-hibp]').trigger('input');
var random_passwd = GPW.pronounceable(8)
if (typeof($(this).closest("form").data('pwgen-length')) == "number") {
var random_passwd = GPW.pronounceable($(this).closest("form").data('pwgen-length'))
}
else {
var random_passwd = GPW.pronounceable(8)
}
$(this).closest("form").find('[data-pwgen-field]').attr('type', 'text');
$(this).closest("form").find('[data-pwgen-field]').val(random_passwd);
});