From 586ab481c2136af57d20ca5e7b9f7d90ef41099f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oj=C4=81rs=20Kapteinis?= Date: Tue, 18 Nov 2025 14:04:38 +0200 Subject: [PATCH] Remove Google OAuth from login/register, enforce email-only authentication - Remove authType state check from LocalLoginForm (always show registration link) - Update .env.example files to set AUTH_TYPE=LOCAL as default - Clarify Google OAuth credentials are only for Gmail/Calendar connectors - Login and register pages now exclusively use email/password authentication This change completes the removal of Google OAuth for user authentication while preserving OAuth functionality for Google Calendar and Gmail connector integrations. --- surfsense_backend/.env.example | 11 +++---- surfsense_web/.env.example | 2 +- .../app/(home)/login/LocalLoginForm.tsx | 30 +++++++------------ 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/surfsense_backend/.env.example b/surfsense_backend/.env.example index 349cb0307..63b49639c 100644 --- a/surfsense_backend/.env.example +++ b/surfsense_backend/.env.example @@ -24,12 +24,13 @@ SCHEDULE_CHECKER_INTERVAL=5m SECRET_KEY=SECRET NEXT_FRONTEND_URL=http://localhost:3000 -# Auth -AUTH_TYPE=GOOGLE or LOCAL +# Auth - Email/Password Authentication +AUTH_TYPE=LOCAL REGISTRATION_ENABLED=TRUE or FALSE -# For Google Auth Only -GOOGLE_OAUTH_CLIENT_ID=924507538m -GOOGLE_OAUTH_CLIENT_SECRET=GOCSV + +# Google OAuth Credentials (OPTIONAL - Required only for Gmail and Google Calendar connectors) +GOOGLE_OAUTH_CLIENT_ID=your_google_client_id +GOOGLE_OAUTH_CLIENT_SECRET=your_google_client_secret # Connector Specific Configs GOOGLE_CALENDAR_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/calendar/connector/callback diff --git a/surfsense_web/.env.example b/surfsense_web/.env.example index 157bfaa37..e45a291af 100644 --- a/surfsense_web/.env.example +++ b/surfsense_web/.env.example @@ -1,5 +1,5 @@ NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000 -NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL or GOOGLE +NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL NEXT_PUBLIC_ETL_SERVICE=UNSTRUCTURED or LLAMACLOUD or DOCLING # Contact Form Vars - OPTIONAL DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.sdsf.supabase.co:5432/postgres \ No newline at end of file diff --git a/surfsense_web/app/(home)/login/LocalLoginForm.tsx b/surfsense_web/app/(home)/login/LocalLoginForm.tsx index 0157c9faf..5bb4cbc40 100644 --- a/surfsense_web/app/(home)/login/LocalLoginForm.tsx +++ b/surfsense_web/app/(home)/login/LocalLoginForm.tsx @@ -24,15 +24,9 @@ export function LocalLoginForm() { title: null, message: null, }); - const [authType, setAuthType] = useState(null); const router = useRouter(); const [{ mutateAsync: login, isPending: isLoggingIn }] = useAtom(loginMutationAtom); - useEffect(() => { - // Get the auth type from environment variables - setAuthType(process.env.NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE || "GOOGLE"); - }, []); - const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError({ title: null, message: null }); // Clear any previous errors @@ -233,19 +227,17 @@ export function LocalLoginForm() { - {authType === "LOCAL" && ( -
-

- {t("dont_have_account")}{" "} - - {t("sign_up")} - -

-
- )} +
+

+ {t("dont_have_account")}{" "} + + {t("sign_up")} + +

+
); }