Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3360162
D11207.id37862.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11207.id37862.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11207: [web] fix regression in error handling
Attached
Detach File
Event Timeline
Log In to Comment