Hey, How can I change email verification link when I overrided emailDelivery for sending email? ema...
w
Hey, How can I change email verification link when I overrided emailDelivery for sending email? emailDelivery: { override: () => { return { sendEmail: async function (input) { await send({ templateVersion: templates.confirmEmail, verificationUrl: input.emailVerifyLink, email: input.user.email, emails: emails.confirmEmail, title: titles.confirm, username: '', }); }, }; }, }, I use Nextjs so I think I need have "/api" after domain e.g. localhost:3000/api/verify-email.
r
hey @weboux so the email verification link is
input.emailVerifyLink
. It's a string - so you can do string manipulation on it to change the domain or path.
w
Aa I need use split function first.
If I have link as "domain:port/api/verify-email, then don't open as website but in "backend" or as website? In Nestjs I have websiteBasePath: '/' because auth forms I have in route '/'.
And apiBasePath: 'auth'.
r
I don’t quite understand your question here.
w
In Nextjs api folder is for backend, another folders pages are frontend sites, so if I have domain:port/verify-email or domain:port/auth/verify-email, users'll see website. But if I'll have domain:port/api/verify-email, users'll get site with information about confirmation of e-mail address/with button for this information and button with redirect link?
I didn't get notification from discord xd
r
the email verification link should open your website
w
And this website should display email verification success message?
r
And call the api to consume the email verification token
w
What api? I cannot find.
r
See our guides
w
I was searching and I don't find.
r
See the email verification section
I’m not sure what you are trying to do here. So I won’t be able to help
w
I undestood wrong this: https://supertokens.com/docs/thirdpartyemailpassword/custom-ui/enable-email-verification#step-6-verifying-the-email-post-link-clicked. So as I understand, I need add button with this function and ask the user to click the button.? and I don't understand this: window.location.assign("/auth/verify-email") // back to the email sending screen. I need create this route on frontend and call: https://supertokens.com/docs/thirdpartyemailpassword/custom-ui/enable-email-verification#step-5-sending-the-email-verification-email ?
r
Yes.
w
Both?
r
yes
w
Thanks :)
4 Views