I have a NextJS project and NextAuth EmailProvider implementaion,
There is custom adapter to put verification token in database:
createVerificationToken: (data) => {
return p.verificationToken.create({ data })
},
The token i get in data
is 28bc226c9f823c02874b247fd173c16053ac64e45607f81f59da52f7775802fa
but in sendVerificationRequestUrl, the token is 3ed3d4ff6d2f12333ba5eac6bb25dc8ad1220e7b0e37de3bc385ede9e0d41582
export const sendVerificationRequest = async ({ identifier, url }: Props) => {
try {
console.log('magic', url, identifier)
await sendMagicLinkEmail({ url, to: identifier })
} catch (err) {
throw new Error(`Email(s) could not be sent`)
}
}
Both token are different but nextAuth is able identify and login.
First question: What kind of token is this?
Second question: The reason is i want to create url without using nextauth, the user will come from different website, it would have already saved token in database, and url will have token which will allow user to login without requiring of email entry.