From fcc8745e95358374d97b9c93c168666eccf31ec1 Mon Sep 17 00:00:00 2001 From: joelbettner Date: Thu, 29 Jul 2021 15:01:57 -0600 Subject: [PATCH 1/2] Different throw for Missing partnerUserSecret --- src/libs/API.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/API.js b/src/libs/API.js index c885298411b0..5a0c4f2cbec1 100644 --- a/src/libs/API.js +++ b/src/libs/API.js @@ -221,6 +221,11 @@ function Authenticate(parameters) { case 401: throw new Error('passwordForm.error.incorrectLoginOrPassword'); case 402: + // If too few characters are passed as the password, the WAF will pass it to the API as an empty + // string, which results in a 402 error from Auth. + if (response.message === "402 Missing partnerUserSecret") { + throw new Error('passwordForm.error.incorrectLoginOrPassword'); + } throw new Error('passwordForm.error.twoFactorAuthenticationEnabled'); case 403: throw new Error('passwordForm.error.invalidLoginOrPassword'); From d363e6c01cc17699af080915a120f9ce55addbb9 Mon Sep 17 00:00:00 2001 From: joelbettner Date: Thu, 29 Jul 2021 15:26:29 -0600 Subject: [PATCH 2/2] Using single quotes --- src/libs/API.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/API.js b/src/libs/API.js index 5a0c4f2cbec1..5fa63cf9dbf4 100644 --- a/src/libs/API.js +++ b/src/libs/API.js @@ -223,7 +223,7 @@ function Authenticate(parameters) { case 402: // If too few characters are passed as the password, the WAF will pass it to the API as an empty // string, which results in a 402 error from Auth. - if (response.message === "402 Missing partnerUserSecret") { + if (response.message === '402 Missing partnerUserSecret') { throw new Error('passwordForm.error.incorrectLoginOrPassword'); } throw new Error('passwordForm.error.twoFactorAuthenticationEnabled');