Allow further customization of generateVerificationToken
in email provider
#9319
THE-SIMPLE-MARK
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
The goals should be self explamantory. I think this part is unnecessary.
Background
So, my story: I was setting up the magic email link provider for my website, when I realized that I should probably add a backup solution for when the link doesn't work for whatever reason. This is good and all, but with the prisma provider, I can't generate this code when the verification token is created (without modifying the db provider; which I consider to be bad practise).
So, I have to use a sleep function in the
sendVerificationRequest
function to wait a 100 milliseconds and then modify the freshly created verification token with the shorter, human readable code. This is code is then sent in the same email as the magic link, but as plain text.I don't see any other better alternatives.
Proposal
Expand the
generateVerificationToken
function so everything returned from it is sent directly to thesendVerificationRequest
function. This would require the removal of most of the hardcoded logic from thesendToken
function.Beta Was this translation helpful? Give feedback.
All reactions