Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/chainlit/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ async def _authenticate_user(
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="credentialssignin",
detail="credentialsSignin",
)

# If a data layer is defined, attempt to persist user.
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/password_auth/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Password Auth', () => {
cy.get("input[name='email']").type('user');
cy.get("input[name='password']").type('user');
cy.get("button[type='submit']").click();
cy.get('body').should('contain', 'Unauthorized');
cy.get('body').should('contain', 'Sign in failed');
});
Comment on lines 29 to 33
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion cy.get('body').should('contain', 'Sign in failed') doesn’t verify the behavior this PR is aiming for (inline Alert is shown and no toast is displayed). Consider asserting on the inline alert element (e.g., .alert) for the translated text, and separately asserting that the toast container (App renders a Toaster with className="toast") does not contain the error / has no toast items, so the test will fail if the global toast reappears.

Copilot uses AI. Check for mistakes.
});

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const on401 = () => {
};

const onError = (error: ClientError) => {
// Don't toast 401 errors — they're handled by the login form (inline Alert)
// and the on401 redirect for other pages.
if (error.status === 401) return;
toast.error(error.toString());
};

Expand Down
5 changes: 1 addition & 4 deletions frontend/src/components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ export function LoginForm({

{errorState && (
<Alert variant="error">
{t([
`auth.login.errors.${errorState.toLowerCase()}`,
`auth.login.errors.default`
])}
{t([`auth.login.errors.${errorState}`, `auth.login.errors.default`])}
</Alert>
)}

Expand Down
Loading