Skip to content

Commit d83583d

Browse files
committed
fix: disable email verification on dev
1 parent 48080b0 commit d83583d

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

packages/auth/src/auth.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,8 @@ export const auth = betterAuth({
127127
minPasswordLength: 8,
128128
maxPasswordLength: 32,
129129
autoSignIn: false,
130-
requireEmailVerification: true,
131-
sendResetPasswordEmail: async ({
132-
user,
133-
url,
134-
}: {
135-
user: any;
136-
url: string;
137-
}) => {
130+
requireEmailVerification: process.env.NODE_ENV === 'production',
131+
sendResetPassword: async ({ user, url }: { user: any; url: string }) => {
138132
const resend = new Resend(process.env.RESEND_API_KEY as string);
139133
await resend.emails.send({
140134
@@ -145,10 +139,8 @@ export const auth = betterAuth({
145139
},
146140
},
147141
emailVerification: {
148-
sendOnSignUp: true,
149-
sendVerificationOnSignUp: true,
150-
disableSignUp: true,
151-
sendVerificationOnSignIn: true,
142+
sendOnSignUp: process.env.NODE_ENV === 'production',
143+
sendOnSignIn: process.env.NODE_ENV === 'production',
152144
autoSignInAfterVerification: true,
153145
sendVerificationEmail: async ({
154146
user,

0 commit comments

Comments
 (0)