Page MenuHomePhabricator

D11207.id37733.diff
No OneTemporary

D11207.id37733.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:20 PM (20 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579649
Default Alt Text
D11207.id37733.diff (1 KB)

Event Timeline