@@ -72,7 +72,7 @@
|
||||
"micro-cors": "0.1.1",
|
||||
"minio": "7.0.32",
|
||||
"next": "13.2.4",
|
||||
"next-auth": "4.20.1",
|
||||
"next-auth": "4.19.2",
|
||||
"@typebot.io/next-international": "0.3.8",
|
||||
"nextjs-cors": "^2.1.2",
|
||||
"nodemailer": "6.9.1",
|
||||
|
||||
@@ -2,18 +2,11 @@ import { sendMagicLinkEmail } from '@typebot.io/emails'
|
||||
|
||||
type Props = {
|
||||
identifier: string
|
||||
token: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export const sendVerificationRequest = async ({ identifier, token }: Props) => {
|
||||
export const sendVerificationRequest = async ({ identifier, url }: Props) => {
|
||||
try {
|
||||
const url = `${
|
||||
process.env.NEXTAUTH_URL
|
||||
}/api/auth/callback/email?${new URLSearchParams({
|
||||
email: identifier,
|
||||
token,
|
||||
callbackUrl: `${process.env.NEXTAUTH_URL}/signin`,
|
||||
}).toString()}`
|
||||
await sendMagicLinkEmail({ url, to: identifier })
|
||||
} catch (err) {
|
||||
throw new Error(`Email(s) could not be sent`)
|
||||
|
||||
Reference in New Issue
Block a user