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:
@@ -27,6 +27,7 @@ import { apiClient } from '@/lib/apiClient';
|
||||
import { useRegister } from './useRegister';
|
||||
import { cn } from '@/lib/utils';
|
||||
import type { GoogleAuthResponse } from '../login/types';
|
||||
import { useGoogleConfig } from '@/providers/ClientGoogleProvider';
|
||||
|
||||
function validateEmail(email: string) {
|
||||
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
||||
@@ -85,7 +86,7 @@ export function RegisterForm() {
|
||||
const searchParams = useSearchParams();
|
||||
const redirect = searchParams.get('redirect') || '/dashboard';
|
||||
|
||||
const googleClientId = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || '';
|
||||
const { clientId: googleClientId, enabled: googleEnabled } = useGoogleConfig();
|
||||
|
||||
const nameError = touched.name && name.length > 0 && name.length < 2
|
||||
? t('register.name.error')
|
||||
@@ -179,7 +180,7 @@ export function RegisterForm() {
|
||||
</CardHeader>
|
||||
|
||||
<CardContent className="space-y-5">
|
||||
{googleClientId && (
|
||||
{googleEnabled && googleClientId && (
|
||||
<>
|
||||
<div className="flex justify-center">
|
||||
{googleLoading ? (
|
||||
|
||||
Reference in New Issue
Block a user