Verification Token Access Functionality #10775
Unanswered
ramonmalcolm10
asked this question in
Help
Replies: 1 comment
-
you can use to genarate pages/api/auth/[...nextauth].js providers: [
EmailProvider({
async generateVerificationToken() {
return "ABC123"
}
})
], you can use async function sendVerificationRequest(params) {
const { identifier, url, provider, theme } = params
const { host } = new URL(url)
// NOTE: You are not required to use `nodemailer`, use whatever you want.
const transport = createTransport(provider.server)
const result = await transport.sendMail({
to: identifier,
from: provider.from,
subject: `Sign in to ${host}`,
text: text({ url, host }),
html: html({ url, host, theme }),
})
const failed = result.rejected.concat(result.pending).filter(Boolean)
if (failed.length) {
throw new Error(`Email(s) (${failed.join(", ")}) could not be sent`)
}
} docs guide: https://next-auth.js.org/providers/email#customizing-emails |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can we access the logic used for generating, hashing, and validating the VerificationToken, used for Email magic link?
Beta Was this translation helpful? Give feedback.
All reactions