Skip to content

Commit

Permalink
Fix STACK-BACKEND-5M
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Dec 23, 2024
1 parent e704408 commit 7ef4f36
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions apps/backend/src/app/api/v1/auth/password/sign-up/route.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { getAuthContactChannel } from "@/lib/contact-channel";
import { createAuthTokens } from "@/lib/tokens";
import { prismaClient } from "@/prisma-client";
import { createSmartRouteHandler } from "@/route-handlers/smart-route-handler";
import { KnownErrors } from "@stackframe/stack-shared";
import { getPasswordError } from "@stackframe/stack-shared/dist/helpers/password";
Expand Down Expand Up @@ -50,19 +48,6 @@ export const POST = createSmartRouteHandler({
throw new KnownErrors.SignUpNotEnabled();
}

const contactChannel = await getAuthContactChannel(
prismaClient,
{
projectId: project.id,
type: "EMAIL",
value: email,
}
);

if (contactChannel) {
throw new KnownErrors.UserEmailAlreadyExists();
}

const createdUser = await usersCrudHandlers.adminCreate({
project,
data: {
Expand All @@ -71,6 +56,7 @@ export const POST = createSmartRouteHandler({
primary_email_auth_enabled: true,
password,
},
allowedErrorTypes: [KnownErrors.UserEmailAlreadyExists],
});

try {
Expand Down

0 comments on commit 7ef4f36

Please sign in to comment.