mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix event
This commit is contained in:
parent
61ba0670f2
commit
d05253c8cd
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user