Repository navigation
feat: add granular signup disable flags - #2765
Conversation
Add per-method signup disable flags so self-hosters with multiple SSO
providers configured can allow signup via, e.g., OIDC only without
disabling Google/Microsoft consumer signup.
New env vars (server-only, no NEXT_PUBLIC_ prefix):
- DISABLE_SIGNUP - master switch, replaces NEXT_PUBLIC_DISABLE_SIGNUP
as the canonical name; also gates the org OIDC portal
- DISABLE_EMAIL_PASSWORD_SIGNUP
- DISABLE_GOOGLE_SIGNUP
- DISABLE_MICROSOFT_SIGNUP
- DISABLE_OIDC_SIGNUP - also blocks new-account creation through the
organisation authentication portal
NEXT_PUBLIC_DISABLE_SIGNUP is kept as a backward-compatible alias for
the master switch.
Per-method flags only block brand-new account creation. Existing users
with the provider already linked can still sign in, and existing email
users can still link an additional provider to their account. SSO
buttons on /signin remain visible regardless of DISABLE_X_SIGNUP since
existing users still need them; brand-new users hitting the callback
get redirected with ?error=SIGNUP_DISABLED.
The /signup loader redirects to /signin when the master switch is on
or every available method is disabled, otherwise it renders only the
still-allowed fields and SSO buttons.
Refs #2692
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
|
🚨 @ephraimduncan has 9 pull requests awaiting review. Please consider reviewing them when possible. 🚨 |
|
I haven't had a full review yet, but I don't think we should introduce a new env convention, i'd prefer just sticking with |
# Conflicts: # apps/remix/app/components/forms/signup.tsx # apps/remix/app/routes/_unauthenticated+/signin.tsx # apps/remix/app/routes/_unauthenticated+/signup.tsx # packages/auth/server/routes/email-password.ts
Description
Add per-method signup disable flags so self-hosters with multiple SSO providers configured can allow signup via, e.g., OIDC only without disabling Google/Microsoft consumer signup. Existing
NEXT_PUBLIC_DISABLE_SIGNUPis kept as a backward-compatible alias for the new canonical master switchDISABLE_SIGNUP.Related Issue
Refs #2692
Changes Made
New env vars (all server-only, no
NEXT_PUBLIC_prefix):DISABLE_SIGNUP— canonical master switch. Disables every signup method application-wide and gates the organisation OIDC authentication portal.DISABLE_EMAIL_PASSWORD_SIGNUP— disables email/password signup only.DISABLE_GOOGLE_SIGNUP,DISABLE_MICROSOFT_SIGNUP,DISABLE_OIDC_SIGNUP— block brand-new account creation through the matching SSO provider.DISABLE_OIDC_SIGNUPalso blocks new-account creation through the organisation portal.NEXT_PUBLIC_DISABLE_SIGNUP— kept as a legacy alias forDISABLE_SIGNUP. Either beingtrueactivates the master switch.Testing Performed
DISABLE_SIGNUP=truealone →/signupredirects,ClaimAccounthidden, all OAuth callbacks (incl. org portal) reject brand-new users.NEXT_PUBLIC_DISABLE_SIGNUP=true(legacy alias) → identical behaviour.DISABLE_EMAIL_PASSWORD_SIGNUP=trueonly → email form andClaimAccounthidden,POST /auth/email-password/signuprejects, OAuth signup still works.DISABLE_GOOGLE_SIGNUP/DISABLE_MICROSOFT_SIGNUP/DISABLE_OIDC_SIGNUPonly → matching button hidden on/signup, still visible on/signin, OAuth callback rejects brand-new users, existing linked users still sign in, existing email users can still link the provider.DISABLE_OIDC_SIGNUPalso blocks new-account creation through the organisation portal; existing org members unaffected./signupredirects to/signin.Checklist