mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support in-home easy password
This commit is contained in:
parent
340fcbb607
commit
27b770b898
3 changed files with 117 additions and 9 deletions
|
@ -2498,6 +2498,28 @@
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates a user's easy password
|
||||
* @param {String} userId
|
||||
* @param {String} newPassword
|
||||
*/
|
||||
self.updateEasyPassword = function (userId, newPassword) {
|
||||
|
||||
if (!userId) {
|
||||
throw new Error("null userId");
|
||||
}
|
||||
|
||||
var url = self.getUrl("Users/" + userId + "/EasyPassword");
|
||||
|
||||
return self.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {
|
||||
newPassword: CryptoJS.SHA1(newPassword).toString()
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets a user's password
|
||||
* @param {String} userId
|
||||
|
@ -2523,6 +2545,27 @@
|
|||
});
|
||||
};
|
||||
|
||||
self.resetEasyPassword = function (userId) {
|
||||
|
||||
if (!userId) {
|
||||
throw new Error("null userId");
|
||||
}
|
||||
|
||||
var url = self.getUrl("Users/" + userId + "/EasyPassword");
|
||||
|
||||
var postData = {
|
||||
|
||||
};
|
||||
|
||||
postData.resetPassword = true;
|
||||
|
||||
return self.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postData
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the server's configuration
|
||||
* @param {Object} configuration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue