Fix mail sending

This commit is contained in:
Clément Pons
2025-04-22 09:28:48 +02:00
parent 7beeed8a61
commit 735dfb6980
5 changed files with 50 additions and 52 deletions

View File

@@ -5,6 +5,7 @@ import { usersDataTable, usersTable } from '~/db/schema';
import { schema } from '~/schemas/registration';
import { checkSession, logSession } from '~/server/utils/user';
import type { UserSession, UserSessionRequired } from '~/types/auth';
import sendMail from '~/server/tasks/mail';
interface SuccessHandler
{
@@ -73,7 +74,7 @@ export default defineEventHandler(async (e): Promise<Return> => {
logSession(e, await setUserSession(e, { user: { id: id.id, username: body.data.username, email: body.data.email, state: 0, signin: new Date(), permissions: [], lastTimestamp: new Date(), logCount: 1 } }) as UserSessionRequired);
await runTask('mail', {
await sendMail({
payload: {
type: 'mail',
to: [body.data.email],