diff --git a/apps/builder/src/pages/api/auth/sendVerificationRequest.ts b/apps/builder/src/pages/api/auth/sendVerificationRequest.ts index cb5e44bcf..930554c07 100644 --- a/apps/builder/src/pages/api/auth/sendVerificationRequest.ts +++ b/apps/builder/src/pages/api/auth/sendVerificationRequest.ts @@ -1,14 +1,18 @@ -import { EmailConfig } from 'next-auth/providers/email' import { sendMagicLinkEmail } from '@typebot.io/emails' type Props = { identifier: string - url: string - provider: Partial> + token: string } -export const sendVerificationRequest = async ({ identifier, url }: Props) => { +export const sendVerificationRequest = async ({ identifier, token }: Props) => { try { + const url = `${ + process.env.NEXTAUTH_URL + }/api/auth/callback/email?${new URLSearchParams({ + email: identifier, + token, + }).toString()}` await sendMagicLinkEmail({ url, to: identifier }) } catch (err) { throw new Error(`Email(s) could not be sent`)