await send email in signup

This commit is contained in:
Zai Shi 2024-04-16 09:10:50 +02:00
parent d355f70916
commit 72711f758b

View File

@ -13,9 +13,6 @@ import { getPasswordError } from "@stackframe/stack-shared/dist/helpers/password
import { getApiKeySet, publishableClientKeyHeaderSchema } from "@/lib/api-keys";
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
import { KnownErrors } from "@stackframe/stack-shared";
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
export const maxDuration = 60;
const postSchema = yup.object({
headers: yup.object({
@ -108,7 +105,11 @@ export const POST = deprecatedSmartRouteHandler(async (req: NextRequest) => {
throw new KnownErrors.RedirectUrlNotWhitelisted();
}
runAsynchronously(sendVerificationEmail(projectId, newUser.projectUserId, emailVerificationRedirectUrl));
try {
await sendVerificationEmail(projectId, newUser.projectUserId, emailVerificationRedirectUrl);
} catch (error) {
console.error(error);
}
return NextResponse.json({
access_token: accessToken,