Folks, if there any way to expire the previous ema...
# support-questions-legacy
n
Folks, if there any way to expire the previous email verification link when the new link is generated by clicking on 'Resend Verification Email'?
n
Hi @namanchhabra_60978 You can use
revokeEmailVerificationTokens
to revoke previously generated tokens for the user
n
Thanks @nkshah2
@nkshah2 Where exactly can we use this function?
n
It’s exposed by the email verification recipe, you’ll need the user I’d of the user so as long as you have that you can use it anywhere
n
I was trying to use it in the send_email function for sending the verification email to the user. The plan was, before sending the new verification email, all the previous links should expire. But, by doing this even the new link gets expired.
n
Are you overriding the send email function?
n
yes
n
Right you want to override the create email verification token function of the email verification recipe
And before you call the original implementation you call revoke tokens
Our docs should explain what overrides are and how to use them
That way every time a new token is generated it will clear old ones
n
Yes, that's exactly what I am trying to do
n
Let me know if you can’t get it to work
8 Views