Wojak
Wojak
Explore posts from servers
BABetter Auth
Created by Steven-sensei on 3/31/2025 in #help
Change email for unverified user ?
If the email with a typo is gonna be used by another user then you can just make a forgot password flow
8 replies
BABetter Auth
Created by Steven-sensei on 3/31/2025 in #help
Change email for unverified user ?
If you require verification then yes. Just create a new one in that case.
8 replies
BABetter Auth
Created by Steven-sensei on 3/31/2025 in #help
Change email for unverified user ?
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema: schema,
}),
emailAndPassword: {
enabled: true,
},
emailVerification: {
sendVerificationEmail: async ({ user, url }) => {
await sendEmail({
to: user.email,
subject: "Verify your email address",
text: `Welcome! Please verify your email address by clicking the link below:\n\n${url}\n\nIf you did not sign up, please ignore this email.`,
});
},
},
user: {
changeEmail: {
enabled: true,
// this is skipped if the user is unverified
sendChangeEmailVerification: async ({ user, url }) => {
await sendEmail({
to: user.email,
subject: "Confirm Your Email Change Request",
text: `You have requested to change your email address. Please confirm this request by clicking the link below:\n\n${url}\n\nIf you did not request this change, please ignore this email.`,
});
},
},
},
});
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema: schema,
}),
emailAndPassword: {
enabled: true,
},
emailVerification: {
sendVerificationEmail: async ({ user, url }) => {
await sendEmail({
to: user.email,
subject: "Verify your email address",
text: `Welcome! Please verify your email address by clicking the link below:\n\n${url}\n\nIf you did not sign up, please ignore this email.`,
});
},
},
user: {
changeEmail: {
enabled: true,
// this is skipped if the user is unverified
sendChangeEmailVerification: async ({ user, url }) => {
await sendEmail({
to: user.email,
subject: "Confirm Your Email Change Request",
text: `You have requested to change your email address. Please confirm this request by clicking the link below:\n\n${url}\n\nIf you did not request this change, please ignore this email.`,
});
},
},
},
});
The methods are authClient.changeEmail for changing the email and authClient.sendVerificationEmail
8 replies
BABetter Auth
Created by Steven-sensei on 3/31/2025 in #help
Change email for unverified user ?
Yes, it is possible. The verification request will directly go to the new email. If the email is already verified, the email will go through the currently verified email first. Then you would have to initiate a verification request afterwards to the new email.
8 replies
PPrisma
Created by Wojak on 3/3/2025 in #help-and-questions
Question about storing/reading dates from database
Thanks for taking the time to respond, got my answer to store and read using ISO 8601
5 replies