1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Handle 403 response codes at login and display an appropriate message

This commit is contained in:
Mark Monteiro 2020-04-13 14:53:51 -04:00
parent 6246dce320
commit 753bf80642
2 changed files with 4 additions and 2 deletions

View file

@ -24,9 +24,10 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout
page.querySelector("#txtManualPassword").value = ""; page.querySelector("#txtManualPassword").value = "";
loading.hide(); loading.hide();
if (response.status === 401) { if (response.status === 401 || response.status === 403) {
require(["toast"], function (toast) { require(["toast"], function (toast) {
toast(Globalize.translate("MessageInvalidUser")); var messageKey = response.status === 401 ? "MessageInvalidUser" : "MessageUnauthorizedUser"
toast(Globalize.translate(messageKey));
}); });
} else { } else {
Dashboard.alert({ Dashboard.alert({

View file

@ -990,6 +990,7 @@
"MessageInstallPluginFromApp": "This plugin must be installed from within the app you intend to use it in.", "MessageInstallPluginFromApp": "This plugin must be installed from within the app you intend to use it in.",
"MessageInvalidForgotPasswordPin": "An invalid or expired pin code was entered. Please try again.", "MessageInvalidForgotPasswordPin": "An invalid or expired pin code was entered. Please try again.",
"MessageInvalidUser": "Invalid username or password. Please try again.", "MessageInvalidUser": "Invalid username or password. Please try again.",
"MessageUnauthorizedUser": "You are not authorized to access the server at this time. Please contact your server administrator for more information.",
"MessageItemSaved": "Item saved.", "MessageItemSaved": "Item saved.",
"MessageItemsAdded": "Items added.", "MessageItemsAdded": "Items added.",
"MessageLeaveEmptyToInherit": "Leave empty to inherit settings from a parent item or the global default value.", "MessageLeaveEmptyToInherit": "Leave empty to inherit settings from a parent item or the global default value.",