mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
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.
This commit is contained in:
parent
333bc9fef2
commit
586ab481c2
3 changed files with 18 additions and 25 deletions
|
|
@ -24,12 +24,13 @@ SCHEDULE_CHECKER_INTERVAL=5m
|
||||||
SECRET_KEY=SECRET
|
SECRET_KEY=SECRET
|
||||||
NEXT_FRONTEND_URL=http://localhost:3000
|
NEXT_FRONTEND_URL=http://localhost:3000
|
||||||
|
|
||||||
# Auth
|
# Auth - Email/Password Authentication
|
||||||
AUTH_TYPE=GOOGLE or LOCAL
|
AUTH_TYPE=LOCAL
|
||||||
REGISTRATION_ENABLED=TRUE or FALSE
|
REGISTRATION_ENABLED=TRUE or FALSE
|
||||||
# For Google Auth Only
|
|
||||||
GOOGLE_OAUTH_CLIENT_ID=924507538m
|
# Google OAuth Credentials (OPTIONAL - Required only for Gmail and Google Calendar connectors)
|
||||||
GOOGLE_OAUTH_CLIENT_SECRET=GOCSV
|
GOOGLE_OAUTH_CLIENT_ID=your_google_client_id
|
||||||
|
GOOGLE_OAUTH_CLIENT_SECRET=your_google_client_secret
|
||||||
|
|
||||||
# Connector Specific Configs
|
# Connector Specific Configs
|
||||||
GOOGLE_CALENDAR_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/calendar/connector/callback
|
GOOGLE_CALENDAR_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/calendar/connector/callback
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000
|
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
|
NEXT_PUBLIC_ETL_SERVICE=UNSTRUCTURED or LLAMACLOUD or DOCLING
|
||||||
# Contact Form Vars - OPTIONAL
|
# Contact Form Vars - OPTIONAL
|
||||||
DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.sdsf.supabase.co:5432/postgres
|
DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.sdsf.supabase.co:5432/postgres
|
||||||
|
|
@ -24,15 +24,9 @@ export function LocalLoginForm() {
|
||||||
title: null,
|
title: null,
|
||||||
message: null,
|
message: null,
|
||||||
});
|
});
|
||||||
const [authType, setAuthType] = useState<string | null>(null);
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [{ mutateAsync: login, isPending: isLoggingIn }] = useAtom(loginMutationAtom);
|
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) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setError({ title: null, message: null }); // Clear any previous errors
|
setError({ title: null, message: null }); // Clear any previous errors
|
||||||
|
|
@ -233,19 +227,17 @@ export function LocalLoginForm() {
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{authType === "LOCAL" && (
|
<div className="mt-4 text-center text-sm">
|
||||||
<div className="mt-4 text-center text-sm">
|
<p className="text-gray-600 dark:text-gray-400">
|
||||||
<p className="text-gray-600 dark:text-gray-400">
|
{t("dont_have_account")}{" "}
|
||||||
{t("dont_have_account")}{" "}
|
<Link
|
||||||
<Link
|
href="/register"
|
||||||
href="/register"
|
className="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400"
|
||||||
className="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400"
|
>
|
||||||
>
|
{t("sign_up")}
|
||||||
{t("sign_up")}
|
</Link>
|
||||||
</Link>
|
</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue