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
55
src/controllers/session/forgotPassword/index.js
Normal file
55
src/controllers/session/forgotPassword/index.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
import globalize from 'globalize';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function processForgotPasswordResult(result) {
|
||||
if ('ContactAdmin' == result.Action) {
|
||||
return void Dashboard.alert({
|
||||
message: globalize.translate('MessageContactAdminToResetPassword'),
|
||||
title: globalize.translate('HeaderForgotPassword')
|
||||
});
|
||||
}
|
||||
|
||||
if ('InNetworkRequired' == result.Action) {
|
||||
return void Dashboard.alert({
|
||||
message: globalize.translate('MessageForgotPasswordInNetworkRequired'),
|
||||
title: globalize.translate('HeaderForgotPassword')
|
||||
});
|
||||
}
|
||||
|
||||
if ('PinCode' == result.Action) {
|
||||
let msg = globalize.translate('MessageForgotPasswordFileCreated');
|
||||
msg += '<br/>';
|
||||
msg += '<br/>';
|
||||
msg += 'Enter PIN here to finish Password Reset<br/>';
|
||||
msg += '<br/>';
|
||||
msg += result.PinFile;
|
||||
msg += '<br/>';
|
||||
return void Dashboard.alert({
|
||||
message: msg,
|
||||
title: globalize.translate('HeaderForgotPassword'),
|
||||
callback: function () {
|
||||
Dashboard.navigate('forgotpasswordpin.html');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default function (view, params) {
|
||||
function onSubmit(e) {
|
||||
ApiClient.ajax({
|
||||
type: 'POST',
|
||||
url: ApiClient.getUrl('Users/ForgotPassword'),
|
||||
dataType: 'json',
|
||||
data: {
|
||||
EnteredUsername: view.querySelector('#txtName').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