Add Facebook social login
This commit is contained in:
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import toast from 'react-hot-toast';
|
||||
import { LoaderCircle, User, Mail, Lock } from 'lucide-react';
|
||||
import { Dialog, DialogContent, DialogTitle, DialogDescription } from '@/components/ui/dialog';
|
||||
import type { GoogleProfilePrefill } from '../marketing/checkout/types';
|
||||
import type { OAuthProfilePrefill } from '../marketing/checkout/types';
|
||||
|
||||
export interface RegisterSuccessPayload {
|
||||
user: unknown | null;
|
||||
@@ -17,8 +17,8 @@ interface RegisterFormProps {
|
||||
onSuccess?: (payload: RegisterSuccessPayload) => void;
|
||||
privacyHtml: string;
|
||||
locale?: string;
|
||||
prefill?: GoogleProfilePrefill;
|
||||
onClearGoogleProfile?: () => void;
|
||||
prefill?: OAuthProfilePrefill;
|
||||
onClearPrefill?: () => void;
|
||||
}
|
||||
|
||||
type RegisterFormFields = {
|
||||
@@ -50,7 +50,7 @@ const resolveMetaCsrfToken = (): string => {
|
||||
return (document.querySelector('meta[name="csrf-token"]') as HTMLMetaElement | null)?.content ?? '';
|
||||
};
|
||||
|
||||
export default function RegisterForm({ packageId, onSuccess, privacyHtml, locale, prefill, onClearGoogleProfile }: RegisterFormProps) {
|
||||
export default function RegisterForm({ packageId, onSuccess, privacyHtml, locale, prefill, onClearPrefill }: RegisterFormProps) {
|
||||
const [privacyOpen, setPrivacyOpen] = useState(false);
|
||||
const [hasTriedSubmit, setHasTriedSubmit] = useState(false);
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
@@ -176,7 +176,7 @@ export default function RegisterForm({ packageId, onSuccess, privacyHtml, locale
|
||||
redirect: json?.redirect ?? null,
|
||||
pending_purchase: json?.pending_purchase ?? json?.user?.pending_purchase ?? false,
|
||||
});
|
||||
onClearGoogleProfile?.();
|
||||
onClearPrefill?.();
|
||||
reset();
|
||||
setHasTriedSubmit(false);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user