Email Authorization

Hey guys. For my web application, once a user signs up using the form, it sends them an email for confirmation. The confirmation link has a redirect to another page which continues the signup process (basically the user giving additionally details). However, when I print out the user, it returns an empty object. I have attached my code below

THE SIGNUP CODE:
try {
const { data: authData, error: authError } = await supabase.auth.signUp({
email,
password,
options: {
data: {
username: username,
name: name,
},
emailRedirectTo: ${process.env.NEXT_PUBLIC_SITE_URL}/signupInformation
}

});

if (authError) throw authError;
if (!authData.user) throw new Error('User creation failed');

return {
success: true,
message: 'Account created successfully! Please check your email to verify your account.'
};
} catch (error: any) {
if (error.message.includes('User already registered')) {
return {
success: false,
message: 'Email already exists. Please try a different valuee.'
}
}

if (error.code === 'unexpected_failure' && error.message.includes('Database error saving new user')) {
return {
success: false,
message: 'Username already exists. Please try a different value.'
};
}

return {
success: false,
message: error.message || 'An error occurred during signup. Please try again.'
};
}

THE EMAIL:
<h1>Welcome to Find A Group</h1>
<h2>Please Confirm your signup</h2>

<p>Follow this link to confirm your user:</p>
<p><a href="{{ .ConfirmationURL }}">Confirm your mail</a></p>
Was this page helpful?