refactoring
This commit is contained in:
parent
dc11213cb5
commit
e1c4fb5744
1 changed files with 17 additions and 4 deletions
|
|
@ -23,7 +23,13 @@ export const auth = betterAuth({
|
|||
emailAndPassword: {
|
||||
enabled: true,
|
||||
requireEmailVerification: true,
|
||||
sendResetPassword: async ({ user, url }) => {
|
||||
sendResetPassword: async ({
|
||||
user,
|
||||
url,
|
||||
}: {
|
||||
user: { email: string };
|
||||
url: string;
|
||||
}) => {
|
||||
await resend.emails.send({
|
||||
from: emailFrom,
|
||||
to: user.email,
|
||||
|
|
@ -33,7 +39,16 @@ export const auth = betterAuth({
|
|||
},
|
||||
},
|
||||
emailVerification: {
|
||||
sendVerificationEmail: async ({ user, url }) => {
|
||||
sendOnSignUp: true,
|
||||
autoSignInAfterVerification: true,
|
||||
sendVerificationEmail: async ({
|
||||
user,
|
||||
url,
|
||||
}: {
|
||||
user: { email: string };
|
||||
url: string;
|
||||
}) => {
|
||||
console.log("Sending verification email to", user.email, url);
|
||||
await resend.emails.send({
|
||||
from: emailFrom,
|
||||
to: user.email,
|
||||
|
|
@ -41,8 +56,6 @@ export const auth = betterAuth({
|
|||
html: `<p>Click <a href="${url}">here</a> to verify your email address.</p>`,
|
||||
});
|
||||
},
|
||||
sendOnSignUp: true,
|
||||
autoSignInAfterVerification: true,
|
||||
},
|
||||
trustedOrigins: [process.env["CORS_ORIGIN"] || "http://localhost:5173"],
|
||||
socialProviders: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue