From e7f595c460ed8488f2b7107e67602bc81ffdddfa Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Mon, 13 Apr 2020 16:41:24 -0400 Subject: [PATCH] Apply code review suggestions --- src/controllers/auth/login.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/auth/login.js b/src/controllers/auth/login.js index 35821f80f6..4b679bbbd8 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 || response.status === 403) { + const UnauthorizedOrForbidden = [401, 403]; + if (UnauthorizedOrForbidden.includes(response.status)) { require(["toast"], function (toast) { - var messageKey = response.status === 401 ? "MessageInvalidUser" : "MessageUnauthorizedUser"; + const messageKey = response.status === 401 ? "MessageInvalidUser" : "MessageUnauthorizedUser"; toast(Globalize.translate(messageKey)); }); } else {