mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update routes for plugin and session pages
This commit is contained in:
parent
c0261ee487
commit
a085bb5269
24 changed files with 39 additions and 28 deletions
43
src/controllers/session/resetPassword/index.js
Normal file
43
src/controllers/session/resetPassword/index.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
import globalize from 'globalize';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function processForgotPasswordResult(result) {
|
||||
if (result.Success) {
|
||||
let msg = globalize.translate('MessagePasswordResetForUsers');
|
||||
msg += '<br/>';
|
||||
msg += '<br/>';
|
||||
msg += result.UsersReset.join('<br/>');
|
||||
return void Dashboard.alert({
|
||||
message: msg,
|
||||
title: globalize.translate('HeaderPasswordReset'),
|
||||
callback: function () {
|
||||
window.location.href = 'index.html';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('MessageInvalidForgotPasswordPin'),
|
||||
title: globalize.translate('HeaderPasswordReset')
|
||||
});
|
||||
}
|
||||
|
||||
export default function (view, params) {
|
||||
function onSubmit(e) {
|
||||
ApiClient.ajax({
|
||||
type: 'POST',
|
||||
url: ApiClient.getUrl('Users/ForgotPassword/Pin'),
|
||||
dataType: 'json',
|
||||
data: {
|
||||
Pin: view.querySelector('#txtPin').value
|
||||
}
|
||||
}).then(processForgotPasswordResult);
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
view.querySelector('form').addEventListener('submit', onSubmit);
|
||||
}
|
||||
|
||||
/* eslint-enable indent */
|
Loading…
Add table
Add a link
Reference in a new issue