Skip to content

bug(platform): the SSO sign-in step says "No organizations are available" while its list loads or after it fails to load #4606

Closed

Description

@yannickmonney

Summary

The Sign in with SSO step (/log-in?method=sso) treats a pending or failed read of the SSO organization list as "no organizations". It then states, in an alert:

No organizations are available for sign-in. Contact your administrator.

  • While loading: the alert renders and, being role="alert", is announced until the list arrives. This happens whenever the step opens without a cached list, for example on a reload or a deep link.
  • After a failed read: the alert stays. There is no Try again, and the person is told to contact an administrator about a configuration that is fine.

This is the sign-in page, where SSO users have no other way in.

Source

In services/platform/app/routes/_auth/log-in.tsx:

  • Line 132: const { data: selectableOrgs } = useSsoSelectableOrgs();. isLoading, isError and refetch are not read. useSsoSelectableOrgs is a plain useQuery(ssoSelectableQuery()) (app/features/auth/hooks/queries.ts:28–30), and the route has no loader that prefetches it.
  • Lines 423–438: selectableOrgs && selectableOrgs.length > 0 ? <SsoOrgPicker …/> : <p role="alert">{t('login.ssoNoOrganizations')}</p>. undefined (pending or failed) takes the "none available" branch.
  • Not tested: log-in-sso-email-prompt.test.tsx:149 covers "no organizations available" with a fixed mock value, and nothing covers pending or failed.

The same text ships in German ("Keine Organisation für die Anmeldung verfügbar. Wende dich an deine Administration.") and French ("Aucune organisation disponible pour la connexion. Contacte ton administration.").

Same class, noted but not traced to the end: routes/setup.tsx:28–48 starts the first-run owner wizard whenever useHasAnyUsers isn't true, which includes a failed read. On an install that already has users, a failed read there opens the first-run wizard. I didn't follow how the owner creation is then refused.

Dedupe: I scanned 294 open items (129 PRs); none covers this.

Reproduction (expected from the code; not run live)

  1. On a multi-organization deployment with SSO enabled, open /log-in?method=sso directly (reload or deep link).
  2. While ssoSelectableQuery is pending, the alert above shows and is announced.
  3. Make that read fail (offline after the page loads, or a server error). The alert stays, with no way to retry except reloading.

Expected

  • Pending: a loading state, with no alert.
  • Failed: say the organization list couldn't load, and offer Try again (refetch). Don't tell the person to contact an administrator.
  • Empty: the current message only after a successful read that returned no organizations.

Regression expectation

Extend log-in-sso-email-prompt.test.tsx:

  • with useSsoSelectableOrgs pending, there's no login.ssoNoOrganizations alert;
  • failed shows a load-failure message with Try again, which refetches;
  • a successful empty list keeps the current message.

Triage

Activity

  1. yannickmonney commented on Oct 9, 2026

    @yannickmonney
    ContributorAuthor

    Follow-up: the /setup path noted above, now traced (main 3bc0b3222, static).

    On an install that already has users, a failed useHasAnyUsers read (routes/setup.tsx:28–48) opens the first-run wizard. Its account step calls authClient.signUp.email (features/organization/components/onboarding/steps/account-step.tsx:82–96).

    The backend's sign-up gate refuses with SIGN_UP_CLOSED_MESSAGE (backend/auth/sign-up-gate.ts): "Sign-up is closed on this deployment; an administrator creates accounts." The step shows that English sentence as the password field's error, with a fallback of "Wrong email or password" when no message comes back.

    So the person isn't sent to sign in. They see an English refusal under the password field of a setup they shouldn't be in. The fix direction for /setup is the same as for the SSO step: a failed read isn't "no users". Retry, or route to sign-in, rather than starting first-run setup.

  2. added
    agent-ready
    on Oct 29, 2026
  3. added a commit that references this issue on Oct 30, 2026
    fc8e161
  4. added 2 commits that reference this issue on Oct 31, 2026
    823c10e
    f06b767
  5. added a commit that references this issue on Nov 1, 2026
    b515f0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions