Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Let self-hosters turn off Google and Microsoft sign in (#3590)

Luke Vella078051bbd8c2
diff --git a/apps/docs/self-hosting/conferencing.mdx b/apps/docs/self-hosting/conferencing.mdx
index d3bc0e43d..e23d33b4f 100644
--- a/apps/docs/self-hosting/conferencing.mdx
+++ b/apps/docs/self-hosting/conferencing.mdx
@@ -51,7 +51,7 @@ Google Meet uses the same Google OAuth app as Google sign in and Google Calendar
https://<YOUR_DOMAIN>/api/integrations/callback/google-meet
```
-Keep the existing `/api/auth/callback/google` URI if you use Google sign in.
+Keep the existing `/api/auth/callback/google` URI if you use Google sign in. To use the client for Google Meet only, set `GOOGLE_LOGIN_ENABLED=false` so the Google sign in button is hidden.
</Accordion>
<ParamField path="GOOGLE_CLIENT_ID">
@@ -108,7 +108,7 @@ https://<YOUR_DOMAIN>/api/integrations/zoom/deauthorize
## Microsoft Teams
-Microsoft Teams uses the same Microsoft Entra ID registration as Microsoft sign in, with an extra redirect URI and Graph permissions. Setting the Microsoft variables for sign in does not turn on Teams: finish the steps below, then add `microsoft-teams` to `CONFERENCING_PROVIDERS`.
+Microsoft Teams uses the same Microsoft Entra ID registration as Microsoft sign in, with an extra redirect URI and Graph permissions. Setting the Microsoft variables for sign in does not turn on Teams: finish the steps below, then add `microsoft-teams` to `CONFERENCING_PROVIDERS`. To use the registration for Teams only, set `MICROSOFT_LOGIN_ENABLED=false` so the Microsoft sign in button is hidden.
<Accordion title="Setup">
1. Register an application in the [Microsoft Entra admin center](https://entra.microsoft.com/), or open your existing one. See [Single Sign-On](/self-hosting/single-sign-on#microsoft) for sign in.
diff --git a/apps/docs/self-hosting/single-sign-on.mdx b/apps/docs/self-hosting/single-sign-on.mdx
index 7064313ea..0156b482d 100644
--- a/apps/docs/self-hosting/single-sign-on.mdx
+++ b/apps/docs/self-hosting/single-sign-on.mdx
@@ -34,6 +34,10 @@ https://<YOUR_DOMAIN>/api/auth/callback/google
The client secret of your Google application.
</ParamField>
+<ParamField path="GOOGLE_LOGIN_ENABLED" default="true">
+ Google sign in is offered when `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` are set. Set to `false` to hide it and keep the Google app for [Google Meet](/self-hosting/conferencing#google-meet) and Google Calendar only.
+</ParamField>
+
## Microsoft
<Accordion title="Setup">
@@ -81,6 +85,10 @@ Under **API permissions**, add the delegated Microsoft Graph permissions `Online
The client secret of your Microsoft application.
</ParamField>
+<ParamField path="MICROSOFT_LOGIN_ENABLED" default="true">
+ Microsoft sign in is offered when `MICROSOFT_CLIENT_ID` and `MICROSOFT_CLIENT_SECRET` are set. Set to `false` to hide it and keep the registration for [Microsoft Teams](/self-hosting/conferencing#microsoft-teams) only.
+</ParamField>
+
## OpenID Connect (OIDC)
If your identity provider supports OAuth 2.0 with OpenID Connect, you can use it to authenticate users on your Rallly instance.
diff --git a/apps/web/src/env.ts b/apps/web/src/env.ts
index 3d0b4da81..cea9c317d 100644
--- a/apps/web/src/env.ts
+++ b/apps/web/src/env.ts
@@ -113,6 +113,8 @@ export const env = createEnv({
*/
GOOGLE_CLIENT_ID: z.string().optional(),
GOOGLE_CLIENT_SECRET: z.string().optional(),
+ // Set to "false" to keep the Google app for Calendar and Meet only.
+ GOOGLE_LOGIN_ENABLED: z.enum(["true", "false"]).default("true"),
/**
* Conferencing integrations (Google Meet, Zoom, Microsoft Teams, Webex).
@@ -133,6 +135,8 @@ export const env = createEnv({
MICROSOFT_TENANT_ID: z.string().optional().default("common"),
MICROSOFT_CLIENT_ID: z.string().optional(),
MICROSOFT_CLIENT_SECRET: z.string().optional(),
+ // Set to "false" to keep the Microsoft registration for Teams only.
+ MICROSOFT_LOGIN_ENABLED: z.enum(["true", "false"]).default("true"),
/**
* App name
@@ -312,6 +316,7 @@ export const env = createEnv({
LICENSE_API_AUTH_TOKEN: process.env.LICENSE_API_AUTH_TOKEN,
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
+ GOOGLE_LOGIN_ENABLED: process.env.GOOGLE_LOGIN_ENABLED,
CONFERENCING_PROVIDERS: process.env.CONFERENCING_PROVIDERS,
ZOOM_CLIENT_ID: process.env.ZOOM_CLIENT_ID,
ZOOM_CLIENT_SECRET: process.env.ZOOM_CLIENT_SECRET,
@@ -321,6 +326,7 @@ export const env = createEnv({
MICROSOFT_TENANT_ID: process.env.MICROSOFT_TENANT_ID,
MICROSOFT_CLIENT_ID: process.env.MICROSOFT_CLIENT_ID,
MICROSOFT_CLIENT_SECRET: process.env.MICROSOFT_CLIENT_SECRET,
+ MICROSOFT_LOGIN_ENABLED: process.env.MICROSOFT_LOGIN_ENABLED,
PRIMARY_COLOR: process.env.PRIMARY_COLOR,
PRIMARY_COLOR_DARK: process.env.PRIMARY_COLOR_DARK,
LOGO_URL: process.env.LOGO_URL,
diff --git a/apps/web/src/lib/auth.ts b/apps/web/src/lib/auth.ts
index 56ac266e0..1e356d707 100644
--- a/apps/web/src/lib/auth.ts
+++ b/apps/web/src/lib/auth.ts
@@ -287,7 +287,9 @@ export const authLib = betterAuth({
],
socialProviders: {
google:
- env.GOOGLE_CLIENT_ID && env.GOOGLE_CLIENT_SECRET
+ env.GOOGLE_LOGIN_ENABLED !== "false" &&
+ env.GOOGLE_CLIENT_ID &&
+ env.GOOGLE_CLIENT_SECRET
? {
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
@@ -295,7 +297,9 @@ export const authLib = betterAuth({
}
: undefined,
microsoft:
- env.MICROSOFT_CLIENT_ID && env.MICROSOFT_CLIENT_SECRET
+ env.MICROSOFT_LOGIN_ENABLED !== "false" &&
+ env.MICROSOFT_CLIENT_ID &&
+ env.MICROSOFT_CLIENT_SECRET
? {
tenantId: env.MICROSOFT_TENANT_ID,
clientId: env.MICROSOFT_CLIENT_ID,