Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Refactor user account creation and OTP sending actions

Kiran K965f5a8a2dcc
diff --git a/apps/web/lib/actions/create-user-account.ts b/apps/web/lib/actions/create-user-account.ts
index 0546e610e5..2f555f6c6b 100644
--- a/apps/web/lib/actions/create-user-account.ts
+++ b/apps/web/lib/actions/create-user-account.ts
@@ -66,6 +66,4 @@ export const createUserAccountAction = actionClient
},
});
}
-
- return { ok: true };
});
diff --git a/apps/web/lib/actions/send-otp.ts b/apps/web/lib/actions/send-otp.ts
index 657c3cba8d..89c8bdc211 100644
--- a/apps/web/lib/actions/send-otp.ts
+++ b/apps/web/lib/actions/send-otp.ts
@@ -16,7 +16,7 @@ import { actionClient } from "./safe-action";
const schema = z.object({
email: emailSchema,
- password: passwordSchema,
+ password: passwordSchema.optional(),
});
// Send OTP to email to verify account
@@ -84,6 +84,7 @@ export const sendOtpAction = actionClient
expires: new Date(Date.now() + EMAIL_OTP_EXPIRY_IN * 1000),
},
}),
+
sendEmail({
subject: `${process.env.NEXT_PUBLIC_APP_NAME}: OTP to verify your account`,
email,
@@ -93,6 +94,4 @@ export const sendOtpAction = actionClient
}),
}),
]);
-
- return { ok: true };
});