mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
move authentication and playback controllers to subdirectories
This commit is contained in:
parent
4bf12b1682
commit
07994e0a40
13 changed files with 12 additions and 12 deletions
53
src/controllers/auth/forgotpassword.js
Normal file
53
src/controllers/auth/forgotpassword.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
define([], function () {
|
||||
"use strict";
|
||||
|
||||
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) {
|
||||
var 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");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return 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);
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue