hossein
04/09/2023, 3:08 PMrecipeList: [
EmailPassword.init(),
EmailVerification.init({
mode: "REQUIRED",
emailDelivery: {
override: (originalImplementation) => {
return {
...originalImplementation,
sendEmail: async function (input) {
console.log('send email verification');
sendEmail();
}
}
}
},
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
generateEmailVerifyTokenPOST: async function (input) {
console.log('generate email verification token');
},
isEmailVerifiedGET: async function (input) {
console.log('is email verified');
},
verifyEmailPOST: async function (input) {
console.log('send email verification');
if (originalImplementation.verifyEmailPOST === undefined) {
throw Error("Should never come here");
}
let response = await originalImplementation.verifyEmailPOST(input);
if (response.status === "OK") {
let { id, email } = response.user;
}
return response;
}
}
}
}
}),
Session.init()
]
});
rp_st
04/09/2023, 3:18 PMoriginalImplementation.sendEmail()
and not just call sendEmail
by itself.
The API calls should be prefixed with the apiBasePath whose default value is /auth
. So you should send a request to /auth/user/email/verify
(or whatever you have set your apiBasePath to be.rp_st
04/09/2023, 3:19 PMhossein
04/09/2023, 3:23 PMrp_st
04/09/2023, 3:24 PMgenerateEmailVerifyTokenPOST
one.hossein
04/09/2023, 3:29 PMrp_st
04/09/2023, 3:29 PMhossein
04/09/2023, 3:31 PMrp_st
04/09/2023, 3:31 PMhossein
04/09/2023, 3:45 PMhttp://localhost:3000/auth/verify-email?token=YWMwYjg1NTEzYzZkYTM3MWJlNWE3ZjdmYWI1ZDRlOWE5NTkxYjIwYjQ0OTc3OGFjNmIzNGIwMGQ2MTU3ZDc0OTY5YjJmMDhmOWE5ZDJhMGQ0OTNiM2RhNTQwODJlMDVl&rid=emailverification
that when I hit it I get Cannot GET /auth/verify-email
rp_st
04/09/2023, 3:46 PMhossein
04/09/2023, 3:48 PMrp_st
04/09/2023, 3:49 PM/{apiBasePath}/user/email/verify
endpoint with the token in the linkhossein
04/09/2023, 3:50 PMrp_st
04/09/2023, 3:50 PMrp_st
04/09/2023, 3:50 PMhossein
04/09/2023, 3:54 PMSuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).
Powered by