Page MenuHomePhabricator

D11207.id37862.diff
No OneTemporary

D11207.id37862.diff

diff --git a/web/account/traditional-login-form.react.js b/web/account/traditional-login-form.react.js
--- a/web/account/traditional-login-form.react.js
+++ b/web/account/traditional-login-form.react.js
@@ -21,6 +21,7 @@
LogInStartingPayload,
} from 'lib/types/account-types.js';
import { logInActionSources } from 'lib/types/account-types.js';
+import { getMessageForException } from 'lib/utils/errors.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';
@@ -95,7 +96,7 @@
} catch (e) {
setUsername('');
setPassword('');
- if (e.message === 'invalid_credentials') {
+ if (getMessageForException(e) === 'invalid_credentials') {
setErrorMessage('incorrect username or password');
} else {
setErrorMessage('unknown error');
@@ -121,7 +122,11 @@
} catch (e) {
setUsername('');
setPassword('');
- if (e.message === 'user not found') {
+ const messageForException = getMessageForException(e);
+ if (
+ messageForException === 'user not found' ||
+ messageForException === 'login failed'
+ ) {
setErrorMessage('incorrect username or password');
} else {
setErrorMessage('unknown error');

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 12:21 PM (20 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579649
Default Alt Text
D11207.id37862.diff (1 KB)

Event Timeline