From 251d45b7f801c7617ad588e035667ba5aa45177b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sat, 22 Nov 2014 20:12:29 +0100 Subject: [PATCH] [fix] Process admin password change following API modifications --- js/app.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index 2c0273c1..faef8a7e 100644 --- a/js/app.js +++ b/js/app.js @@ -1673,12 +1673,16 @@ app = Sammy('#main', function (sam) { store.clear('slide'); c.redirect('#/tools/adminpw'); } else { - // Remove useless variable - delete params['confirm_new_password']; - // Update password and redirect to the home - c.api('/adminpw', function(data) { // http://api.yunohost.org/#!/tools/tools_adminpw_put_3 - c.redirect('#/logout'); - }, 'PUT', params); + c.api('/login', function(data) { + // Remove useless variable + delete params['old_password']; + delete params['confirm_new_password']; + + // Update password and redirect to the home + c.api('/adminpw', function(data) { // http://api.yunohost.org/#!/tools/tools_adminpw_put_3 + c.redirect('#/logout'); + }, 'PUT', params); + }, 'POST', { 'password': params['old_password'] }, false); } });