future42
future42
BABetter Auth
Created by future42 on 3/2/2025 in #bug-reports
twoFactor.verifyTotp missing trustDevice: true
I’m a little bit confused about trustDevice: true. It works with: twoFactor.verifyOtp But not with: twoFactor.verifyTotp Could this be related to the new “remember me” feature? I couldn’t find anything about it in the docs. 😔
4 replies
BABetter Auth
Created by future42 on 10/19/2024 in #bug-reports
signUp on server-side not sending sendVerificationEmail()
Since the changes in v0.4.12 (though I’m not 100% sure), sendVerificationEmail() is no longer triggered automatically when I call auth.api.signUpEmail(). Next.js Server-Action:
await auth.api.signUpEmail({
body: {
email,
password,
name,
callbackURL: "/auth/login",
},
asResponse: true,
});
...
await auth.api.signUpEmail({
body: {
email,
password,
name,
callbackURL: "/auth/login",
},
asResponse: true,
});
...
auth.ts:
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
...
emailAndPassword: {
enabled: true,
requireEmailVerification: true,
},
emailVerification: {
sendOnSignup: true,
sendVerificationEmail: async (user, url) => {
console.log("Sending verification email to", user.email);
await sendVerificationEmailNodemailer(user.email, url);
},
},
...
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
...
emailAndPassword: {
enabled: true,
requireEmailVerification: true,
},
emailVerification: {
sendOnSignup: true,
sendVerificationEmail: async (user, url) => {
console.log("Sending verification email to", user.email);
await sendVerificationEmailNodemailer(user.email, url);
},
},
...
Yes, I can manually call sendVerificationEmail() in my server action but I don’t think that’s the intended way to handle this:
await auth.api.sendVerificationEmail({
body: { email, callbackURL: "/auth/login" },
asResponse: true,
});
await auth.api.sendVerificationEmail({
body: { email, callbackURL: "/auth/login" },
asResponse: true,
});
9 replies