Skip to content

feat(auth): hide/show GitHub & Google login (#384) - #492

Open
grootbro wants to merge 1 commit into
Openpanel-dev:mainfrom
grootbro:feat/hide-show-auth-providers-384
Open

feat(auth): hide/show GitHub & Google login (#384)#492
grootbro wants to merge 1 commit into
Openpanel-dev:mainfrom
grootbro:feat/hide-show-auth-providers-384

Conversation

@grootbro

@grootbro grootbro commented Sep 7, 2026

Copy link
Copy Markdown

Summary

  • Social login buttons render only when the matching OAuth credentials are set (CLIENT_ID + SECRET + REDIRECT_URI)
  • Optional DISABLE_GITHUB_AUTH / DISABLE_GOOGLE_AUTH to hide login while keeping Google creds for Search Console
  • auth.getOAuthProviders + server-side gate on signInOAuth
  • Docs: self-hosting guide + environment variables for GitHub/Google setup

Fixes #384

Test plan

  • Self-host without OAuth env → login/onboarding show email only (no Or divider)
  • Set GitHub credentials only → GitHub button appears; Google hidden
  • Set DISABLE_GOOGLE_AUTH=true with Google creds → Google button hidden
  • Cloud (both providers configured) → both buttons still show
  • signInOAuth for a disabled provider returns a bad-request error
  • CI: oauth-providers unit tests pass

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added support for configurable GitHub and Google social login on self-hosted installations.
    • Login and onboarding screens now display social sign-in options only when providers are fully configured and enabled.
    • Added validation to prevent sign-in attempts through disabled providers.
  • Documentation

    • Added setup instructions and environment variable references for configuring or hiding GitHub and Google sign-in.
    • Clarified that email/password login remains available without additional social login setup.
  • Tests

    • Added coverage for provider credential requirements, disable flags, and provider availability.

Self-hosters can enable GitHub/Google via env vars (or hide with
DISABLE_*_AUTH). Document setup; login/onboarding follow server flags.
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 7b8d5304-fb2f-4df0-944b-eba0fca92af0

📥 Commits

Reviewing files that changed from the base of the PR and between 3060ca1 and 26a1e6b.

📒 Files selected for processing (9)
  • apps/public/content/docs/self-hosting/environment-variables.mdx
  • apps/public/content/docs/self-hosting/self-hosting.mdx
  • apps/start/src/hooks/use-oauth-providers.ts
  • apps/start/src/routes/_login.login.tsx
  • apps/start/src/routes/_public.onboarding.tsx
  • packages/auth/src/index.ts
  • packages/auth/src/oauth-providers.test.ts
  • packages/auth/src/oauth-providers.ts
  • packages/trpc/src/routers/auth.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change adds GitHub and Google OAuth configuration helpers, exposes provider availability through tRPC, blocks disabled sign-in attempts, conditionally renders login and onboarding controls, adds tests, and documents self-hosted OAuth setup.

Changes

OAuth provider availability

Layer / File(s) Summary
Provider configuration and validation
packages/auth/src/oauth-providers.ts, packages/auth/src/oauth-providers.test.ts, packages/auth/src/index.ts
The auth package detects configured providers, applies disable flags, exports availability helpers, and tests credential and flag handling.
Auth provider API and sign-in guard
packages/trpc/src/routers/auth.ts
The auth router exposes enabled providers, accepts only GitHub and Google for OAuth sign-in, and rejects disabled providers.
Conditional login and onboarding UI
apps/start/src/hooks/use-oauth-providers.ts, apps/start/src/routes/_login.login.tsx, apps/start/src/routes/_public.onboarding.tsx
The login and onboarding routes preload provider availability and render OAuth controls only for enabled providers.
Self-hosting OAuth documentation
apps/public/content/docs/self-hosting/environment-variables.mdx, apps/public/content/docs/self-hosting/self-hosting.mdx
The documentation describes OAuth variables, setup steps, redirect URIs, and disable flags.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 26a1e

GitHub and Google login buttons now reflect configured credentials and disable flags, while disabled providers are rejected server-side and email authentication remains available. No concrete merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant LoginPage
  participant AuthRouter
  participant AuthConfig
  participant Environment
  LoginPage->>AuthRouter: request OAuth provider availability
  AuthRouter->>AuthConfig: evaluate enabled providers
  AuthConfig->>Environment: read credentials and disable flags
  Environment-->>AuthConfig: return configuration
  AuthConfig-->>AuthRouter: return provider states
  AuthRouter-->>LoginPage: return enabled providers
Loading

Suggested reviewers: lindesvard

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly summarizes the main change: configurable visibility for GitHub and Google authentication providers.
Linked Issues check ✅ Passed The changes satisfy issue #384 by adding provider visibility controls, conditional login buttons, server-side provider validation, and documentation for GitHub and Google OAuth configuration.
Out of Scope Changes check ✅ Passed The code, tests, documentation, and API changes are directly related to configurable GitHub and Google authentication providers and the requirements in issue #384.
Full details: Docstring Coverage

Explanation

Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

Hide/Show Auth Providers

1 participant