how to run an internal action when ctx is not available to us
export const NodemailerOTP = Email({
server: {
host: process.env.EMAIL_SERVER_HOST,
port: Number(process.env.EMAIL_SERVER_PORT),
auth: {
user: process.env.EMAIL_SERVER_USER,
pass: process.env.EMAIL_SERVER_PASSWORD,
},
},
from: process.env.EMAIL_FROM,
id: "nodemailer-otp",
maxAge: 60 * 15, // 15 minutes
generateVerificationToken: generateOTP,
sendVerificationRequest: async ({
identifier: toEmail,
provider,
token,
},) => {
// how to run an internal action? there is no `ctx`!!
},
});
I am using the above in convexAuth
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
providers: [NodemailerOTP],
callbacks: {
},
});