diff options
Diffstat (limited to 'src/components/header/authdialog/RegisterForm.tsx')
| -rw-r--r-- | src/components/header/authdialog/RegisterForm.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/header/authdialog/RegisterForm.tsx b/src/components/header/authdialog/RegisterForm.tsx index ef22433..604b26c 100644 --- a/src/components/header/authdialog/RegisterForm.tsx +++ b/src/components/header/authdialog/RegisterForm.tsx @@ -8,6 +8,12 @@ import { useAuthContext } from '@/lib/contexts/Auth.context'; import Image from 'next/image'; import { useRouter } from 'next/navigation'; export default function RegisterForm({ redirectTo }: { redirectTo?: string }) { + const API_URL = process.env.NEXT_PUBLIC_API_URL; + + const handleGoogleLogin = () => { + window.location.href = `${API_URL}/api/auth/google/login`; + }; + const [errors, setErrors] = useState<any>({}); const [loading, setLoading] = useState(false); const router = useRouter(); @@ -53,7 +59,11 @@ export default function RegisterForm({ redirectTo }: { redirectTo?: string }) { onSubmit={handleSubmit} className="flex flex-col gap-5 min-w-[310px] w-fit" > - <Button className="w-full bg-white hover:bg-white hover:text-black"> + <Button + type="button" + onClick={handleGoogleLogin} + className="w-full bg-white hover:bg-white hover:text-black" + > <GoogleIcon /> <span className="text-black">Войти через Google</span> </Button> |
