Skip to content

Commit

Permalink
Empty the password field on submission of the form
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 10, 2016
1 parent ea7a0ca commit 00da391
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions core/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -1546,11 +1546,7 @@ OC.PasswordConfirmation = {
if (this.requiresPasswordConfirmation()) {
this.$form.removeClass('hidden');
this.$background.removeClass('hidden');

// Hack against firefox ignoring autocomplete="off"
if (this.$input.val() === ' ') {
this.$input.val('');
}
this.$input.val('');
}

this.callback = callback;
Expand All @@ -1568,6 +1564,7 @@ OC.PasswordConfirmation = {
},
type: 'POST',
success: function(response) {
self.$input.val('');
nc_lastLogin = response.lastLogin;
self.$submit.addClass('icon-confirm').removeClass('icon-loading-small');

Expand All @@ -1579,6 +1576,7 @@ OC.PasswordConfirmation = {
}
},
error: function() {
self.$input.val('');
OC.Notification.showTemporary(t('core', 'Failed to authenticate, try again'));
self.$submit.addClass('icon-confirm').removeClass('icon-loading-small');
}
Expand Down
2 changes: 1 addition & 1 deletion core/templates/layout.user.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

<div id="sudo-login-background" class="hidden"></div>
<div id="sudo-login-form" class="hidden">
<input type="password" class="question" autocomplete="off" name="question" value=" "
<input type="password" class="question" autocomplete="off" name="question" value=" <?php /* Hack against firefox ignoring autocomplete="off" */ ?>"
placeholder="<?php p($l->t('Confirm your password')); ?>" />
<input class="confirm icon-confirm" title="<?php p($l->t('Confirm')); ?>" value="" type="submit">
</div>
Expand Down

0 comments on commit 00da391

Please sign in to comment.