Skip to content

fix(auth): an OAuth provider without a client secret cannot start a sign-in - #631

Merged
lindesvard merged 1 commit into
mainfrom
fix-ci
Oct 29, 2026
Merged

lindesvard merged 1 commit into
mainfrom
fix-ci

Conversation

@lindesvard

@lindesvard lindesvard commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Google and GitHub sign-in now refuse to start unless client id, client secret and redirect URI are all set, matching what the login page shows. This also turns main green again: a test still called the signInOAuth procedure that the move to better-auth removed.

Fixed

  • A Google or GitHub provider configured without its client secret was hidden on the login page, but starting its sign-in directly gave a server error. It is now rejected as "provider not found", before any cookie is set.

Internal

  • The provider list and better-auth's provider setup share one completeness check.
  • The sign-in rejection test moved from the tRPC auth tests to the better-auth suite and now covers each missing credential.

Summary by CodeRabbit

  • Bug Fixes
    • Google and GitHub sign-in options are now available only when all required credentials are configured. Providers with incomplete credentials are hidden, and Google sign-in cannot start when a required credential is missing.
    • Updated checks ensure provider availability and sign-in behavior follow the same credential requirements.

…ign-in

#568 made Google and GitHub count as configured only when client id, client
secret and redirect URI are all set, but #608 moved sign-in to better-auth,
which still registered a provider without its secret. Starting that sign-in
failed with a server error instead of a clean "provider not found".

Both the provider list and better-auth's provider registration now use the same
completeness check. The test for the removed signInOAuth procedure moves to the
better-auth suite, which fixes the failing typecheck and core tests on main.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

OAuth provider readiness now uses one shared check that requires a client ID, client secret, and redirect URI. Provider availability and Better Auth registration use this check. Tests cover incomplete credentials and provider visibility.

Changes: OAuth provider readiness

Layer / File(s) Summary
Define OAuth readiness check
packages/core/src/modules/auth/src/oauth.ts
Adds isOAuthClientConfigured, which returns true only when the client ID, client secret, and redirect URI are all truthy.
Apply readiness check to providers
packages/core/src/modules/auth/auth.service.ts, packages/core/src/modules/auth/src/better-auth.ts, packages/core/src/modules/auth/src/better-auth.test.ts, packages/core/src/modules/auth/auth.rpc.test.ts
Uses the shared check when reporting configured providers and registering Google and GitHub with Better Auth. Tests check that incomplete credentials hide providers and that Google sign-in returns a 404 without cookies. The RPC test no longer checks sign-in rejection or response cookies.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • Openpanel-dev/openpanel#568: Added the original OAuth credential checks; this PR extracts and applies the check to Better Auth registration.
  • Openpanel-dev/openpanel#608: Moved Google and GitHub sign-in to Better Auth; this PR adds the credential completeness requirement to provider registration.
  • Openpanel-dev/openpanel#591: Redesigned dashboard Google and GitHub sign-in flows; this PR updates the backend provider availability checks used by those flows.
Merge Risk: Minimal · up to 8329c

The change aligns OAuth provider visibility and sign-in eligibility. No merge-blocking issue is identified; merge after normal checks pass.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies the main behavior change: an incompletely configured OAuth provider cannot start sign-in. It is narrower than the implementation because the check also requires a clien…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title accurately identifies the main behavior change: an incompletely configured OAuth provider cannot start sign-in. It is narrower than the implementation because the check also requires a client ID and redirect URI.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lindesvard
lindesvard merged commit f0cbd53 into main Oct 29, 2026
13 checks passed
@lindesvard
lindesvard deleted the fix-ci branch October 29, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant