fix: resolve Google login hydration mismatch and dynamic env load
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s

This commit is contained in:
2026-06-07 12:21:06 +02:00
parent 5b8c29dae6
commit feea02033b
6 changed files with 127 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ import { useI18n } from '@/lib/i18n';
import { apiClient } from '@/lib/apiClient';
import { useLogin } from './useLogin';
import type { GoogleAuthResponse } from './types';
import { useGoogleConfig } from '@/providers/ClientGoogleProvider';
export function LoginForm() {
const [email, setEmail] = useState('');
@@ -28,7 +29,7 @@ export function LoginForm() {
const searchParams = useSearchParams();
const redirect = searchParams.get('redirect') || '/dashboard';
const googleClientId = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || '';
const { clientId: googleClientId, enabled: googleEnabled } = useGoogleConfig();
useEffect(() => {
if (loginMutation.isError && loginMutation.error) {
@@ -97,7 +98,7 @@ export function LoginForm() {
</CardHeader>
<CardContent className="space-y-6">
{googleClientId && (
{googleEnabled && googleClientId && (
<>
<div className="flex justify-center">
{googleLoading ? (