diff --git a/src/components/appRouter.js b/src/components/appRouter.js index a602d6dce8..17b51b376d 100644 --- a/src/components/appRouter.js +++ b/src/components/appRouter.js @@ -200,7 +200,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM var apiClient = this; - if (data.status === 401) { + if (data.status === 403) { if (data.errorCode === "ParentalControl") { var isCurrentAllowed = currentRouteInfo ? (currentRouteInfo.route.anonymous || currentRouteInfo.route.startup) : true; diff --git a/src/controllers/auth/login.js b/src/controllers/auth/login.js index 4296b8bfb3..4b679bbbd8 100644 --- a/src/controllers/auth/login.js +++ b/src/controllers/auth/login.js @@ -24,9 +24,11 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout page.querySelector("#txtManualPassword").value = ""; loading.hide(); - if (response.status === 401) { + const UnauthorizedOrForbidden = [401, 403]; + if (UnauthorizedOrForbidden.includes(response.status)) { require(["toast"], function (toast) { - toast(Globalize.translate("MessageInvalidUser")); + const messageKey = response.status === 401 ? "MessageInvalidUser" : "MessageUnauthorizedUser"; + toast(Globalize.translate(messageKey)); }); } else { Dashboard.alert({ diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 3cfaed92df..a44dece13b 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -990,6 +990,7 @@ "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.", "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.", "MessageItemsAdded": "Items added.", "MessageLeaveEmptyToInherit": "Leave empty to inherit settings from a parent item or the global default value.",