User email verification manually does not working
I have a button in my dashboard to send verification email to user. But for unverified user I see this error: You can only send a verification email to an unverified email
const handleUserVerification = async (email: string, status: boolean) => {
if (!status) {
const { error } = await client.sendVerificationEmail({
email,
callbackURL: '/login' // The redirect URL after verification
})
if (!error) {
toast.add({
title: 'Email Sent!',
description: Email has been sent to: ${email}.,
})
} else {
toast.add({
title: 'Error',
description: error.message,
})
}
return
}
// Show Toast message
toast.add({
title: 'User Already Verified!',
description: 'User has been accepted verification email.',
})
}