Diesel
08/24/2022, 9:03 AMAPIs: func(originalImplementation tpmodels.APIInterface) tpmodels.APIInterface {
originalSignInUpPOST := *originalImplementation.SignInUpPOST
(*originalImplementation.SignInUpPOST) = func(provider tpmodels.TypeProvider, code string, authCodeResponse interface{}, redirectURI string, options tpmodels.APIOptions, userContext supertokens.UserContext) (tpmodels.SignInUpPOSTResponse, error) {
response, err := originalSignInUpPOST(provider, code, authCodeResponse, redirectURI, options, userContext)
if err != nil {
return tpmodels.SignInUpPOSTResponse{}, err
}
if response.OK != nil {
user := response.OK.User
somethingError := doSomething(user)
if somethingError != nil {
return tpmodels.SignInUpPOSTResponse{}, somethingError
}
}
return response, nil
}
return originalImplementation
},
If doSomething(user) fails Im getting the error i expect and also a bad http code from the signinup api but its still come with the Set-Cookie and the FrontToken headers in the response and i do not want that.
Any idea how can i prevent that?rp_st
08/24/2022, 10:10 AMrp_st
08/24/2022, 10:12 AMoptions
argument to the function. You can perhaps remove all the headers from there?
You can also open an issue about this on our github and we can come up with an inbuilt solution for this as it seems like the right thing to do.Diesel
08/24/2022, 10:19 AMrp_st
08/24/2022, 10:19 AM