feat(auth): hide Google sign-in until OAuth is configured

Google social login has no credentials in production, so the "Continue with
Google" button (and its divider) errored on click. Gate the button + divider on
a new isGoogleConfigured() helper (requires GOOGLE_CLIENT_ID + GOOGLE_CLIENT_SECRET)
on both the login and signup pages, and guard the signInWithGoogle action as
defense in depth. The button reappears automatically once both env vars are set.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Leon Serfaty
2026-07-03 08:26:08 -04:00
co-authored by Claude Opus 4.8
parent e5e987eb4c
commit 595a5e3e04
4 changed files with 61 additions and 37 deletions
+9
View File
@@ -116,3 +116,12 @@ export const auth = betterAuth({
],
})
/**
* Whether Google OAuth is configured. The auth pages hide the "Continue with
* Google" button unless BOTH credentials are present, so users never see a
* social option that can't complete. Mirrors socialProviders.google above.
*/
export function isGoogleConfigured(): boolean {
return Boolean(process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET)
}