aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/js/settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/js/settings.js')
-rw-r--r--apps/files_external/js/settings.js27
1 files changed, 17 insertions, 10 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 5cbd011bcc1..61f1696545a 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -1488,30 +1488,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;
});