hooks: {
after: createAuthMiddleware(async (ctx) => {
const isFromEmail = ctx.path.startsWith('/verify-email');
if (isFromEmail) {
const newSession = ctx.context.newSession;
if (newSession) {
const user = newSession.user;
try {
await sendProductEventMessage(`[NEW USER SIGNED UP] ${user.name} (${user.email})`);
} catch (error) {
console.error('Error sending product event message', error);
}
}
}
}),
},
hooks: {
after: createAuthMiddleware(async (ctx) => {
const isFromEmail = ctx.path.startsWith('/verify-email');
if (isFromEmail) {
const newSession = ctx.context.newSession;
if (newSession) {
const user = newSession.user;
try {
await sendProductEventMessage(`[NEW USER SIGNED UP] ${user.name} (${user.email})`);
} catch (error) {
console.error('Error sending product event message', error);
}
}
}
}),
},