fix event

This commit is contained in:
SrGooglo 2025-02-25 23:09:46 +00:00
parent 61ba0670f2
commit d05253c8cd

View File

@ -1,9 +1,20 @@
import templates from "../templates" import templates from "../templates"
export default async (ctx, data) => { export default async (ctx, data) => {
const { user_id, username, email, apr_link, created_at, expires_at, ip_address, client } = data const { code, created_at, expires_at, ip_address, client } = data
const { email, username } = data.user
if (!user_id || !username || !email || !apr_link || !created_at || !expires_at || !ip_address || !client) { console.log(`Sending password recovery email to ${email}`)
if (
!username ||
!email ||
!code ||
!created_at ||
!expires_at ||
!ip_address ||
!client
) {
throw new OperationError(400, "Bad request") throw new OperationError(400, "Bad request")
} }
@ -13,9 +24,7 @@ export default async (ctx, data) => {
subject: "Password reset", subject: "Password reset",
html: templates.password_recovery({ html: templates.password_recovery({
username: username, username: username,
code: code,
apr_link: apr_link,
date: new Date(created_at), date: new Date(created_at),
ip: ip_address, ip: ip_address,
client: client, client: client,