Hi, I'm upgrading from supertokens 9 to supertoken...
# support-questions
i
Hi, I'm upgrading from supertokens 9 to supertokens 12 in NestJs and i'm changing the position of my methods for email delivery (password reset and email verification). In the previous implementation i had a variable with my apikey for email provider that i needed in the email delivery method (with a value assigned in the constructor of the service). After the upgrade (and the change of position of delivery methods) my variable is now undefined. Can u help me?
r
hey @Impecorator
Can you show me the old code you had, vs the new one you are trying out?
i
yeah, let me edit a little to hide sensible keys
this is the old one
and this is the new one
the sendinBlueApiKey is undefined in the resetPasswordUsingTokenFeature createAndSendCustomEmail method
r
When you say that ". After the upgrade (and the change of position of delivery methods) my variable is now undefined" - can you please elaborate on it?
i
in verion 9 the emailVerification method was under the ThirdPartyEmailPassword.init(). Now in version 12 the emailVerification method is under the EmailVerification.init()
the problem is in the emailVerification method and in the reset password method
r
hmm. that is really strange.
i
the reset password method didn't change in the two versions
r
So one thing is that you should not use
createAndSendCustomEmail
anymore
i
btw in both of them sendinBlueApiKey value is undefined
r
So it's undefined in both of the
sendEmail
functions?
i
yep
i have to remove the resetPasswordUsingTokenFeature under the ThirdPartyEmailPassword.init() in version 12?
maybe could be the problem?
r
yea you can remove that, but i don't think thats the issue anyway
are you sure that the sendEmail function is being called? Can you print something at the very start of it?
cause a variable disappearing within scope is very, very strange
i
i'm testing it now. my console log was in my AuthUtility.createAndSendCustomPasswordResetEmail that was called in both the methods
r
Hmm. Okay. Lmk
i
ok. We found it! The problem was the resetPasswordUsingTokenFeature. Removing that the variable now have the value
Ty
r
hmm. Okay!
2 Views