mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 18:52:53 -04:00
fix: add PasswordConfirmationRequired to saveGlobalCredentials
Co-authored-by: yemkareems <yemkareems@gmail.com> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> [skip ci]
This commit is contained in:
parent
3065d75fee
commit
734fe2d23f
1 changed files with 17 additions and 10 deletions
|
|
@ -1457,30 +1457,37 @@ window.addEventListener('DOMContentLoaded', function() {
|
|||
}
|
||||
});
|
||||
|
||||
$('#global_credentials').on('submit', function() {
|
||||
var $form = $(this);
|
||||
function _submitCredentials(success) {
|
||||
var uid = $form.find('[name=uid]').val();
|
||||
var user = $form.find('[name=username]').val();
|
||||
var password = $form.find('[name=password]').val();
|
||||
var $submit = $form.find('[type=submit]');
|
||||
$submit.val(t('files_external', 'Saving …'));
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({
|
||||
uid: uid,
|
||||
user: user,
|
||||
password: password
|
||||
uid,
|
||||
user,
|
||||
password,
|
||||
}),
|
||||
url: OC.generateUrl('apps/files_external/globalcredentials'),
|
||||
dataType: 'json',
|
||||
success: function() {
|
||||
success,
|
||||
});
|
||||
}
|
||||
|
||||
$('#global_credentials').on('submit', function() {
|
||||
var $form = $(this);
|
||||
var $submit = $form.find('[type=submit]');
|
||||
$submit.val(t('files_external', 'Saving …'));
|
||||
|
||||
window.OC.PasswordConfirmation
|
||||
.requirePasswordConfirmation(() => _submitCredentials(function() {
|
||||
$submit.val(t('files_external', 'Saved'));
|
||||
setTimeout(function(){
|
||||
$submit.val(t('files_external', 'Save'));
|
||||
}, 2500);
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue