fix: resolve Google login hydration mismatch and dynamic env load
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s
This commit is contained in:
@@ -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 ? (
|
||||
|
||||
Reference in New Issue
Block a user