mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #941 - Rework password recovery and remove IsLocal checks
This commit is contained in:
parent
0adfd30015
commit
7f6f74fb54
11 changed files with 263 additions and 40 deletions
63
dashboard-ui/scripts/forgotpasswordpin.js
Normal file
63
dashboard-ui/scripts/forgotpasswordpin.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
(function (window) {
|
||||
|
||||
function processForgotPasswordResult(page, result) {
|
||||
|
||||
if (result.Success) {
|
||||
|
||||
var msg = Globalize.translate('MessagePasswordResetForUsers');
|
||||
|
||||
msg += '<br/>';
|
||||
msg += '<br/>';
|
||||
msg += result.UsersReset.join('<br/>');
|
||||
|
||||
Dashboard.alert({
|
||||
|
||||
message: msg,
|
||||
title: Globalize.translate('HeaderPasswordReset'),
|
||||
|
||||
callback: function () {
|
||||
|
||||
window.location = 'login.html';
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.alert({
|
||||
|
||||
message: Globalize.translate('MessageInvalidForgotPasswordPin'),
|
||||
title: Globalize.translate('HeaderPasswordReset')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
function onSubmit(page) {
|
||||
|
||||
ApiClient.ajax({
|
||||
|
||||
type: 'POST',
|
||||
url: ApiClient.getUrl('Users/ForgotPassword/Pin'),
|
||||
dataType: 'json',
|
||||
data: {
|
||||
Pin: $('#txtPin', page).val()
|
||||
}
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
processForgotPasswordResult(page, result);
|
||||
});
|
||||
}
|
||||
|
||||
window.ForgotPasswordPinPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
var page = $(this).parents('.page');
|
||||
|
||||
onSubmit(page);
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(window);
|
Loading…
Add table
Add a link
Reference in a new issue