Skip to content

Commit 92eaaf8

Browse files
authored
Merge pull request #4313 from Expensify/joel_402Login
Different throw for Missing partnerUserSecret
2 parents 99063f7 + d363e6c commit 92eaaf8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libs/API.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ function Authenticate(parameters) {
221221
case 401:
222222
throw new Error('passwordForm.error.incorrectLoginOrPassword');
223223
case 402:
224+
// If too few characters are passed as the password, the WAF will pass it to the API as an empty
225+
// string, which results in a 402 error from Auth.
226+
if (response.message === '402 Missing partnerUserSecret') {
227+
throw new Error('passwordForm.error.incorrectLoginOrPassword');
228+
}
224229
throw new Error('passwordForm.error.twoFactorAuthenticationEnabled');
225230
case 403:
226231
throw new Error('passwordForm.error.invalidLoginOrPassword');

0 commit comments

Comments
 (0)