1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #7 from hawken93/fix_522

Fix firefox failing to set password for users with no password set
This commit is contained in:
Joshua M. Boniface 2019-01-10 22:29:55 -05:00 committed by GitHub
commit 754d68a286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,11 @@ define(["loading", "libraryMenu", "emby-linkbutton"], function(loading, libraryM
var userId = params.userId, var userId = params.userId,
currentPassword = view.querySelector("#txtCurrentPassword").value, currentPassword = view.querySelector("#txtCurrentPassword").value,
newPassword = view.querySelector("#txtNewPassword").value; newPassword = view.querySelector("#txtNewPassword").value;
if(view.querySelector("#fldCurrentPassword").classList.contains("hide")) {
// Firefox does not respect autocomplete=off, so clear it if the field is supposed to be hidden (and blank)
// This should only happen when user.HasConfiguredPassword is false, but this information is not passed on
currentPassword = "";
}
ApiClient.updateUserPassword(userId, currentPassword, newPassword).then(function() { ApiClient.updateUserPassword(userId, currentPassword, newPassword).then(function() {
loading.hide(), require(["toast"], function(toast) { loading.hide(), require(["toast"], function(toast) {
toast(Globalize.translate("PasswordSaved")) toast(Globalize.translate("PasswordSaved"))
@ -93,4 +98,4 @@ define(["loading", "libraryMenu", "emby-linkbutton"], function(loading, libraryM
loadUser(view, params) loadUser(view, params)
}) })
} }
}); });