mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
module resolution for appRouter and moved controllers to dir
This commit is contained in:
parent
d49fee2a29
commit
9c758a8d85
49 changed files with 464 additions and 530 deletions
34
src/controllers/forgotpassword.js
Normal file
34
src/controllers/forgotpassword.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
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");
|
||||
return msg += "<br/>", msg += "<br/>", msg += result.PinFile, msg += "<br/>", void Dashboard.alert({
|
||||
message: msg,
|
||||
title: Globalize.translate("HeaderForgotPassword")
|
||||
})
|
||||
}
|
||||
}
|
||||
return function(view, params) {
|
||||
function onSubmit(e) {
|
||||
return ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl("Users/ForgotPassword"),
|
||||
dataType: "json",
|
||||
data: {
|
||||
EnteredUsername: view.querySelector("#txtName").value
|
||||
}
|
||||
}).then(processForgotPasswordResult), e.preventDefault(), !1
|
||||
}
|
||||
view.querySelector("form").addEventListener("submit", onSubmit)
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue