Handle incomplete profile completion for sign-in and sign-up attempts
The useProfileCompletion hook manages the profile completion flow when users have incomplete sign-in or sign-up attempts that require additional information or verification.
function OAuthProfileCompletion() { const { attempt, attemptType, handleComplete } = useProfileCompletion(); // This would typically be on a dedicated route like /complete-profile useEffect(() => { // Check if this is an OAuth signup that needs completion if (attempt && attemptType === 'signup' && attempt.oauth_provider) { console.log('Completing OAuth signup for:', attempt.oauth_provider); } }, [attempt, attemptType]); if (!attempt) { return <div>No profile completion needed</div>; } return ( <div className="oauth-completion"> <h2>Almost There!</h2> <p> You've signed up with {attempt.oauth_provider}. Just a few more details needed: </p> <ProfileCompletionForm attempt={attempt} onComplete={handleComplete} prefillData={{ email: attempt.email, first_name: attempt.oauth_first_name, last_name: attempt.oauth_last_name }} /> </div> );}