Skip to content

Commit bf1ae96

Browse files
gilluminateclaude
andcommitted
ENG-3370: Fix incorrect error message on login with bad credentials (#7882)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f7206cb commit bf1ae96

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type: Fixed
2+
description: Fixed login page showing SSO configuration error instead of generic login failure message when entering incorrect credentials
3+
pr: 7882
4+
labels: []

clients/admin-ui/src/pages/login.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,25 @@ const useLogin = () => {
168168
dispatch(login(user));
169169
} catch (error) {
170170
setShowAnimation(false);
171-
// eslint-disable-next-line no-console
172-
console.log(error);
173-
let defaultErrorMsg: string;
171+
console.error(error);
172+
let errorMsg: string;
174173
if (isFromInvite) {
175-
defaultErrorMsg = "Setup failed. Please try the invite link again.";
174+
// Invite and reset-password flows may surface backend error detail
175+
// (e.g. expired/invalid token) since it is actionable to the user.
176+
errorMsg = getErrorMessage(
177+
error as RTKErrorResult["error"],
178+
"Setup failed. Please try the invite link again.",
179+
);
176180
} else if (isResetPassword) {
177-
defaultErrorMsg =
178-
"Password reset failed. The link may have expired. Please request a new one.";
181+
errorMsg = getErrorMessage(
182+
error as RTKErrorResult["error"],
183+
"Password reset failed. The link may have expired. Please request a new one.",
184+
);
179185
} else {
180-
defaultErrorMsg =
181-
"Login failed. Please check your credentials and try again.";
186+
// Always show a generic message for standard login failures to avoid
187+
// leaking backend details (SSO config, authorization state, etc.)
188+
errorMsg = "Login failed. Please check your credentials and try again.";
182189
}
183-
const errorMsg = getErrorMessage(
184-
error as RTKErrorResult["error"],
185-
defaultErrorMsg,
186-
);
187190
message.error(errorMsg);
188191
} finally {
189192
setIsSubmitting(false);

0 commit comments

Comments
 (0)