From 753bf80642ff7e73896db8e2492f59e476744ebe Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Mon, 13 Apr 2020 14:53:51 -0400 Subject: [PATCH] Handle 403 response codes at login and display an appropriate message --- src/controllers/auth/login.js | 5 +++-- src/strings/en-us.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/auth/login.js b/src/controllers/auth/login.js index 4296b8bfb3..440a777762 100644 --- a/src/controllers/auth/login.js +++ b/src/controllers/auth/login.js @@ -24,9 +24,10 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout page.querySelector("#txtManualPassword").value = ""; loading.hide(); - if (response.status === 401) { + if (response.status === 401 || response.status === 403) { require(["toast"], function (toast) { - toast(Globalize.translate("MessageInvalidUser")); + var 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 990145ee95..a71505d57d 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.",