Lucas Dias
04/18/2024, 5:52 PMrp_st
04/18/2024, 5:53 PMrp_st
04/18/2024, 5:55 PMThirdPartyPasswordless.init({
contactMethod: "...",
flowType: "...",
override: {
functions: (oI) => {
return {
...oI,
createCode: async (input) => {
if ("email" in input && input.email === "YOUR EMAIL") {
return oI.createCode({
...input,
userInputCode: "0000000"
})
}
return oI.createCode(input);
}
}
}
}
})
This goes in the backend configLucas Dias
04/18/2024, 6:04 PMts
recipeList: [
ThirdPartyPasswordless.init({
validatePhoneNumber: () => undefined,
emailDelivery: {
override: originalImplementation => {
return {
...originalImplementation,
//...
}
},
},
}),
Session.init({
jwt: {
enable: true,
},
override: {
functions: function (originalImplementation) {
return {
...originalImplementation,
createNewSession: async function (input) {
//...
},
}
},
},
}),
]
I'm using "supertokens-node": "^12.1.1" version. I tried as you instructed, but I'm getting the following error:
"Property 'createCode' does not exist on type 'RecipeInterface'."
Could it be that in this version, the method has a different name?rp_st
04/18/2024, 6:06 PMLucas Dias
04/18/2024, 6:07 PMts
Session.init({
jwt: {
enable: true,
},
override: {
functions: function (originalImplementation) {
return {
...originalImplementation,
createCode: async (input) => {
if ("email" in input && input.email === "YOUR EMAIL") {
return originalImplementation.createCode({
...input,
userInputCode: "0000000"
})
}
return originalImplementation.createCode(input);
},
createNewSession: async function (input) {
//...
},
}
},
},
})
rp_st
04/18/2024, 6:08 PMrp_st
04/18/2024, 6:08 PMLucas Dias
04/18/2024, 6:19 PMrp_st
04/18/2024, 6:20 PMrp_st
04/18/2024, 6:20 PMrp_st
04/18/2024, 6:20 PMLucas Dias
04/18/2024, 6:20 PMLucas Dias
04/18/2024, 6:22 PMrp_st
04/18/2024, 6:22 PMLucas Dias
04/18/2024, 6:23 PMDarko
04/18/2024, 6:32 PMLucas Dias
04/18/2024, 6:36 PM