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"});