Resend Verification Email
I'm trying to resend the email verification when a user tries to sign-in and has not yet verified their email..
I'm getting the correct error code but the email never gets sent...
async function onSubmit(values: z.infer<typeof signInFormSchema>) {
const { email, password } = values;
await authClient.signIn.email(
{ email, password, callbackURL: "/dashboard"} ,
{
onRequest: () => {},
onSuccess: () => {},
onError: async (ctx) => {
if (ctx.error.status === 403) {
setError("Check inbox, verify email");
console.log("sending email to ...", email);
// resend the verification email
try {
await authClient.sendVerificationEmail({
email,
callbackURL: "/dashboard",
});
toast({title: "Verification email sent"}); async function onSubmit(values: z.infer<typeof signInFormSchema>) {
const { email, password } = values;
await authClient.signIn.email(
{ email, password, callbackURL: "/dashboard"} ,
{
onRequest: () => {},
onSuccess: () => {},
onError: async (ctx) => {
if (ctx.error.status === 403) {
setError("Check inbox, verify email");
console.log("sending email to ...", email);
// resend the verification email
try {
await authClient.sendVerificationEmail({
email,
callbackURL: "/dashboard",
});
toast({title: "Verification email sent"});I'm getting the correct error code but the email never gets sent...
POST /api/auth/sign-in/email?currentURL=http%3A%2F%2Flocalhost%3A3001%2Fsign-in 403 in 5016ms
POST /api/auth/send-verification-email?currentURL=http%3A%2F%2Flocalhost%3A3001%2Fsign-in 200 in 275ms POST /api/auth/sign-in/email?currentURL=http%3A%2F%2Flocalhost%3A3001%2Fsign-in 403 in 5016ms
POST /api/auth/send-verification-email?currentURL=http%3A%2F%2Flocalhost%3A3001%2Fsign-in 200 in 275ms