File tree Expand file tree Collapse file tree 6 files changed +35
-3
lines changed
Expand file tree Collapse file tree 6 files changed +35
-3
lines changed Original file line number Diff line number Diff line change 11import { env } from '@/lib/core/config/env'
2- import { isProd } from '@/lib/core/config/feature-flags'
2+ import {
3+ isGithubAuthDisabled ,
4+ isGoogleAuthDisabled ,
5+ isProd ,
6+ } from '@/lib/core/config/feature-flags'
37
48export async function getOAuthProviderStatus ( ) {
5- const githubAvailable = ! ! ( env . GITHUB_CLIENT_ID && env . GITHUB_CLIENT_SECRET )
9+ const githubAvailable =
10+ ! ! ( env . GITHUB_CLIENT_ID && env . GITHUB_CLIENT_SECRET ) && ! isGithubAuthDisabled
611
7- const googleAvailable = ! ! ( env . GOOGLE_CLIENT_ID && env . GOOGLE_CLIENT_SECRET )
12+ const googleAvailable =
13+ ! ! ( env . GOOGLE_CLIENT_ID && env . GOOGLE_CLIENT_SECRET ) && ! isGoogleAuthDisabled
814
915 return { githubAvailable, googleAvailable, isProduction : isProd }
1016}
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ export const env = createEnv({
260260 GOOGLE_CLIENT_SECRET : z . string ( ) . optional ( ) , // Google OAuth client secret
261261 GITHUB_CLIENT_ID : z . string ( ) . optional ( ) , // GitHub OAuth client ID for GitHub integration
262262 GITHUB_CLIENT_SECRET : z . string ( ) . optional ( ) , // GitHub OAuth client secret
263+ DISABLE_GOOGLE_AUTH : z . boolean ( ) . optional ( ) , // Disable Google OAuth login even when credentials are configured
264+ DISABLE_GITHUB_AUTH : z . boolean ( ) . optional ( ) , // Disable GitHub OAuth login even when credentials are configured
263265
264266 X_CLIENT_ID : z . string ( ) . optional ( ) , // X (Twitter) OAuth client ID
265267 X_CLIENT_SECRET : z . string ( ) . optional ( ) , // X (Twitter) OAuth client secret
Original file line number Diff line number Diff line change @@ -150,6 +150,18 @@ export const isInvitationsDisabled = isTruthy(env.DISABLE_INVITATIONS)
150150 */
151151export const isPublicApiDisabled = isTruthy ( env . DISABLE_PUBLIC_API )
152152
153+ /**
154+ * Is Google OAuth login disabled
155+ * When true, the Google OAuth login button is hidden even when credentials are configured
156+ */
157+ export const isGoogleAuthDisabled = isTruthy ( env . DISABLE_GOOGLE_AUTH )
158+
159+ /**
160+ * Is GitHub OAuth login disabled
161+ * When true, the GitHub OAuth login button is hidden even when credentials are configured
162+ */
163+ export const isGithubAuthDisabled = isTruthy ( env . DISABLE_GITHUB_AUTH )
164+
153165/**
154166 * Is React Grab enabled for UI element debugging
155167 * When true and in development mode, enables React Grab for copying UI element context to clipboard
Original file line number Diff line number Diff line change 4545 RESEND_API_KEY : " your-resend-api-key"
4646 GOOGLE_CLIENT_ID : " your-google-client-id"
4747 GOOGLE_CLIENT_SECRET : " your-google-client-secret"
48+ # DISABLE_GOOGLE_AUTH: "true" # Uncomment to hide Google OAuth login
49+ # DISABLE_GITHUB_AUTH: "true" # Uncomment to hide GitHub OAuth login
4850
4951# Realtime service
5052realtime :
Original file line number Diff line number Diff line change 184184 "type" : " string" ,
185185 "description" : " GitHub OAuth client secret"
186186 },
187+ "DISABLE_GOOGLE_AUTH" : {
188+ "type" : " string" ,
189+ "description" : " Set to 'true' to hide Google OAuth login even when credentials are configured"
190+ },
191+ "DISABLE_GITHUB_AUTH" : {
192+ "type" : " string" ,
193+ "description" : " Set to 'true' to hide GitHub OAuth login even when credentials are configured"
194+ },
187195 "OPENAI_API_KEY" : {
188196 "type" : " string" ,
189197 "description" : " Primary OpenAI API key"
Original file line number Diff line number Diff line change 109109 GOOGLE_CLIENT_SECRET : " " # Google OAuth client secret
110110 GITHUB_CLIENT_ID : " " # GitHub OAuth client ID
111111 GITHUB_CLIENT_SECRET : " " # GitHub OAuth client secret
112+ DISABLE_GOOGLE_AUTH : " " # Set to "true" to hide Google OAuth login
113+ DISABLE_GITHUB_AUTH : " " # Set to "true" to hide GitHub OAuth login
112114
113115 # Google Vertex AI Configuration
114116 VERTEX_PROJECT : " " # Google Cloud project ID for Vertex AI
You can’t perform that action at this time.
0 commit comments