flixoflax
08/25/2022, 4:21 PMrp_st
08/25/2022, 4:27 PMrp_st
08/25/2022, 4:28 PMflixoflax
08/25/2022, 4:31 PMflixoflax
08/25/2022, 4:31 PMflixoflax
08/25/2022, 4:31 PMflixoflax
08/25/2022, 4:34 PMsendVerificationMail
on the frontend to trigger the send mail function, but I would like to trigger it in the backend within an api handler.flixoflax
08/25/2022, 4:35 PMrp_st
08/25/2022, 4:45 PMts
let userInfo = await ThirdPartyEmailPassword.getUserById("<userId>");
if (userInfo !== undefined) {
let resp = await ThirdPartyEmailPassword.createEmailVerificationToken(userInfo.id);
if (resp.status === "OK") {
let token = resp.token;
await ThirdPartyEmailPassword.sendEmail({
// you can use your own websiteDomain / websiteBasePath
emailVerifyLink: `http://localhost:3000/auth/verify-email?token=${token}&rid=thirdpartyemailpassword`,
type: "EMAIL_VERIFICATION",
user: {
email: userInfo.email,
id: userInfo.id
},
userContext: {} // this doesn't matter
})
}
}
flixoflax
08/25/2022, 4:47 PMsendVerificationMail
does on the backend.rp_st
08/25/2022, 4:51 PMflixoflax
08/25/2022, 4:51 PMrp_st
08/25/2022, 4:52 PMrp_st
08/25/2022, 4:52 PM