Skip to content

fix(web): surface SSO login errors to the user#38335

Open
SquabbyZ wants to merge 1 commit into
langgenius:mainfrom
SquabbyZ:fix/sso-login-missing-error-handler
Open

fix(web): surface SSO login errors to the user#38335
SquabbyZ wants to merge 1 commit into
langgenius:mainfrom
SquabbyZ:fix/sso-login-missing-error-handler

Conversation

@SquabbyZ

@SquabbyZ SquabbyZ commented Jul 2, 2026

Copy link
Copy Markdown

Fixes #38412

The SSO login button at web/app/signin/components/sso-auth.tsx chains getUser*SSOUrl(...).then(...).finally(...) for all three protocols (SAML, OIDC, OAuth2). When the network call rejects — e.g. enterprise SSO endpoint misconfigured, CORS error, server 5xx — the rejection is silently swallowed by .finally() and the UI just stays in the loading state with no user feedback.

This change adds a .catch() before each .finally() that emits a toast.error('error.ssoFailed') so the user knows the login attempt failed and the button re-enables. A new error.ssoFailed key is added to web/i18n/en-US/login.json; other locales will be resynced by the i18n:check workflow.

diff --stat:
web/app/signin/components/sso-auth.tsx | 6 ++++++
web/i18n/en-US/login.json | 2 ++
2 files changed, 8 insertions(+)

Generated via peaks-loop (session 2026-07-02-session-95565c, request 2026-07-02-fix-sso-login-missing-error-handler). Red-line scope was limited to sso-auth.tsx and one new i18n key.

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

The SSO login button at web/app/signin/components/sso-auth.tsx chains
getUser*SSOUrl(...).then(...).finally(...) for all three protocols
(SAML, OIDC, OAuth2). When the network call rejects — e.g. enterprise
SSO endpoint misconfigured, CORS error, server 5xx — the rejection is
silently swallowed by .finally() and the UI just stays in the loading
state with no user feedback.

This change adds a .catch() before each .finally() that emits a
toast.error('error.ssoFailed') so the user knows the login attempt
failed and the button re-enables. A new error.ssoFailed key is added
to web/i18n/en-US/login.json; other locales will be resynced by the
i18n:check workflow.

diff --stat:
  web/app/signin/components/sso-auth.tsx | 6 ++++++
  web/i18n/en-US/login.json              | 2 ++
  2 files changed, 8 insertions(+)

Generated via peaks-loop (session 2026-07-02-session-95565c, request
2026-07-02-fix-sso-login-missing-error-handler). Red-line scope was
limited to sso-auth.tsx and one new i18n key.
@SquabbyZ SquabbyZ requested review from douxc and iamjoel as code owners July 2, 2026 15:43
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 2, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jul 2, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution. Before we review this PR, please open an issue first to describe the problem, expected behavior, and proposed approach, then link that issue here. This helps us confirm the scope and align on the fix before moving forward.

@SquabbyZ

SquabbyZ commented Jul 4, 2026

Copy link
Copy Markdown
Author

@crazywoola Thanks for the guidance. Opened issue #38412 describing the SSO login button silently swallowing 5xx / CORS / network errors, the proposed .catch() with toast.error(t('error.ssoFailed')), and the new i18n key. PR description now links the issue via Fixes #38412. Note: this PR is also missing the standard PR-template sections (Summary/Screenshots/Checklist) — let me know if you want me to re-author it from the Bug-Report template, or whether updating the issue is sufficient. Ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSO login button silently swallows 5xx / CORS / network errors from getUserSSOUrl()

2 participants