alisha
05/30/2022, 8:01 AMrp
05/30/2022, 8:03 AMalisha
05/30/2022, 8:03 AM{
"code": "code",
"thirdPartyId": "google",
"redirectURI": "http://localhost:3000/auth/callback/google",
"firstName": "abc"
}
APIs: func(originalImplementation tpepmodels.APIInterface) tpepmodels.APIInterface {
// First we copy the original implementation
originalThirdPartySignInUpPOST := *originalImplementation.ThirdPartySignInUpPOST
// we override the thirdpartyemailpassword signinup POST API to return the social provider's access token
(*originalImplementation.ThirdPartySignInUpPOST) = func(provider tpmodels.TypeProvider, code string, authCodeResponse interface{}, redirectURI string, options tpmodels.APIOptions, userContext supertokens.UserContext) (tpepmodels.ThirdPartyOutput, error) {
body := options.Req.Body
strBody, err := ioutil.ReadAll(body)
if err != nil {
fmt.Println("err in printing body", err)
}
fmt.Printf("strBody??? %s", strBody)
// first we call the original implementation
resp, err := originalThirdPartySignInUpPOST(provider, code, authCodeResponse, redirectURI, options, userContext)
if err != nil {
return tpepmodels.ThirdPartyOutput{}, err
}
bodyyyyyyy {0xc00071e080 0xc00011e240}
strBody???
rp
05/30/2022, 8:09 AMalisha
05/30/2022, 8:10 AMrp
05/30/2022, 8:29 AM