diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index efdc6fe82..86d884d4e 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -788,8 +788,10 @@ static const NSString *kJwtKey = @"jwt"; [us disableForceResetPassword]; } } + + response = [self responseWithStatus: 200 andJSONRepresentation: + [NSDictionary dictionaryWithObjectsAndKeys: [SOGoUser getEncryptedUsernameIfNeeded:username], @"username", nil]]; - response = [self responseWith204]; if (!passwordRecovery) { authCookie = [auth cookieWithUsername: username andPassword: newPassword diff --git a/UI/WebServerResources/js/Common/Authentication.service.js b/UI/WebServerResources/js/Common/Authentication.service.js index c0381f2e5..97c8260c2 100644 --- a/UI/WebServerResources/js/Common/Authentication.service.js +++ b/UI/WebServerResources/js/Common/Authentication.service.js @@ -183,8 +183,12 @@ 'X-XSRF-TOKEN' : xsrfCookie }, data: { userName: userName, newPassword: newPassword, oldPassword: oldPassword, token: token } - }).then(function() { - d.resolve({url: redirectUrl(userName, domain)}); + }).then(function (response) { + if (response && response.data && response.data.username) { + d.resolve({ url: redirectUrl(response.data.username, domain) }); + } else { + d.resolve({ url: redirectUrl(userName, domain) }); + } }, function(response) { var error, data = response.data,