yarfink
06/18/2022, 8:23 PM{{apiBasePath}}/auth/user/email/verify
by default)?
Or am I misunderstanding and ST-website should be able to process that handshake for me (after the user clicks the verify link)?nkshah2
06/19/2022, 3:41 AMyarfink
06/19/2022, 9:42 AMnkshah2
06/20/2022, 7:57 AMnkshah2
06/20/2022, 7:59 AMyarfink
06/20/2022, 8:41 AMyarfink
06/20/2022, 8:55 AMnkshah2
06/20/2022, 9:08 AMoverride: {
functions(originalImpl) {
return {
...originalImpl,
...
async verifyEmailUsingToken(input) {
// Do your custom logic before ST here
// This will let ST do its logic including adding to the schema
const STResult = await originalImpl.verifyEmailUsingToken(input);
// Remove the verified email from ST or any other ST schema changes here
return STResult;
},
...
}
}
}
nkshah2
06/20/2022, 9:09 AMoriginalImpl
allows you to call any of the ST SDK functions for that recipe so you dont have to duplicate the SDK logic yourselfnkshah2
06/20/2022, 9:09 AMyarfink
06/20/2022, 9:10 AMyarfink
06/20/2022, 9:10 AMnkshah2
06/20/2022, 9:10 AMnkshah2
06/20/2022, 9:11 AMSTEmailVerification.someFunction
. Now when you override someFunction
, that line of code will execute your version of the function instead of the SDKs
But we also give you access to the original set of functions that the SDK implements (via originalImpl) should you need themnkshah2
06/20/2022, 9:12 AMoriginalImpl.someFunction
it always refers to the SuperTokens version of that functionyarfink
06/20/2022, 9:12 AMnkshah2
06/20/2022, 9:12 AMnkshah2
06/20/2022, 9:13 AMyarfink
06/20/2022, 9:14 AMnkshah2
06/20/2022, 9:15 AMnkshah2
06/20/2022, 9:15 AMnkshah2
06/20/2022, 9:16 AMyarfink
06/20/2022, 9:16 AMnkshah2
06/20/2022, 9:17 AMnkshah2
06/20/2022, 9:17 AMnkshah2
06/20/2022, 9:17 AMnkshah2
06/20/2022, 9:18 AMyarfink
06/20/2022, 9:18 AMyarfink
06/20/2022, 9:18 AMyarfink
06/20/2022, 9:18 AMnkshah2
06/20/2022, 9:20 AMnkshah2
06/20/2022, 9:20 AMnkshah2
06/20/2022, 9:21 AMyarfink
06/20/2022, 9:21 AMyarfink
06/20/2022, 9:22 AMyarfink
06/20/2022, 9:22 AMnkshah2
06/20/2022, 9:24 AMverifyEmailUsingToken
api (similar to how you are doing function overrides) to simply call the ST version first and then call revokeEmailVerificationTokens
before returning. That way everytime the CDI marks an email as verified it will immediately be removednkshah2
06/20/2022, 9:24 AMnkshah2
06/20/2022, 9:25 AMnkshah2
06/20/2022, 9:25 AMyarfink
06/20/2022, 9:35 AMrevokeEmailVerificationTokens
call unverifyUser
? Not quite sure how it would otherwise remove the a verified user from ST?nkshah2
06/20/2022, 9:35 AM"/recipe/user/email/verify/token/remove"
endpointnkshah2
06/20/2022, 9:35 AMnkshah2
06/20/2022, 9:36 AMnkshah2
06/20/2022, 9:36 AMnkshah2
06/20/2022, 9:36 AMyarfink
06/20/2022, 9:38 AMnkshah2
06/20/2022, 9:41 AM