Auth tweaks
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 26s

This commit is contained in:
Ahmed Al-Taiar
2024-10-09 20:44:12 -04:00
parent 738260f7de
commit b8063e8692
6 changed files with 11 additions and 49 deletions

View File

@ -111,9 +111,7 @@ ${domain}/reset-password?resetToken=${resetToken}
// the database. Returning anything truthy will automatically log the user
// in. Return `false` otherwise, and in the Reset Password page redirect the
// user to the login page.
handler: (_user) => {
return true
},
handler: (_user) => false,
// If `false` then the new password MUST be different from the current one
allowReusedPassword: true,

View File

@ -15,15 +15,14 @@ const transporter = nodemailer.createTransport({
},
})
export const sendEmail = async ({ to, subject, text, html }: Options) => {
return await transporter.sendMail({
export const sendEmail = async ({ to, subject, text, html }: Options) =>
await transporter.sendMail({
from: `"${process.env.FIRST_NAME} ${process.env.LAST_NAME} (noreply)" <${process.env.GMAIL}>`,
to: Array.isArray(to) ? to : [to],
subject,
text,
html,
})
}
export const censorEmail = (email: string): string => {
const [localPart, domain] = email.split('@')