rp
03/29/2021, 10:43 AMankitjey
03/29/2021, 10:44 AMrp
03/29/2021, 10:44 AMankitjey
03/29/2021, 10:44 AMankitjey
03/29/2021, 10:44 AMrp
03/29/2021, 10:45 AMrp
03/29/2021, 10:45 AMankitjey
03/29/2021, 10:45 AMrp
03/29/2021, 10:46 AMankitjey
03/29/2021, 10:47 AMrp
03/29/2021, 10:48 AMankitjey
03/29/2021, 10:48 AMrp
03/29/2021, 10:53 AMankitjey
03/29/2021, 10:59 AMuser
03/29/2021, 9:44 PMothiagocruz
03/29/2021, 11:54 PMcodefingers
03/30/2021, 1:27 AM(context: ThirdPartyEmailPasswordPreApiHookCotext) => RequesInit
and wrap it with a promise like (context: ThirdPartyEmailPasswordPreApiHookCotext) => Promise<RequesInit>
then use the extended type on preApiHook.
Feel free to paste code here so we see the exact mistake you're making and show how to correct you.othiagocruz
03/30/2021, 1:55 AMcodefingers
03/30/2021, 2:23 AMpreAPIHook(context)
?
in your code, You simply just need to replace (context: ThirdPartyEmailPasswordPreApiHookContext) => RequestInit
with (context: ThirdPartyEmailPasswordPreApiHookContext) => Promise<RequestInit>
codefingers
03/30/2021, 2:23 AMcodefingers
03/30/2021, 2:26 AMcodefingers
03/30/2021, 2:54 AMcodefingers
03/30/2021, 3:25 AMrp
03/30/2021, 5:10 AMrp
03/30/2021, 5:19 AMts
import {ThirdPartyEmailPasswordPreAPIHookContext} from "supertokens-auth-react/recipe/thirdpartyemailpassword"
ThirdPartyEmailPassword.init({
async preAPIHook(context: ThirdPartyEmailPasswordPreAPIHookContext) {
// TODO:...
}
});
Reference code can be found here: https://github.com/supertokens/supertokens-auth-react/blob/master/examples/with-typescript/src/App.tsx#L251rp
03/30/2021, 5:56 AMuser
03/30/2021, 6:18 AMrp
03/30/2021, 6:27 AMothiagocruz
03/30/2021, 9:24 AM