Hi There! Can we customize the response send by su...
# support-questions
r
Hi There! Can we customize the response send by supertokens after login/signup?
r
Hey @rkritesh210 yes you can
Which recipe are you using?
r
EmailPassword. I did signUpPOST overide, changed the email that was sent by user from frontend and then signed up with 'updated email'. But I want to send the same email that was sent by the user to the frontend in the response.
r
In that case, you want to override all the recipe functions ("override > functions" instead of "override > apis") such that if the input to any of the functions is an email, you convert them before they are sent to the core. And if the output of calling the original implementation has an email, then you convert it back before returning it from the function.
r
How can we check the output of original implementation in backend ?
r
you can do, for example:
Copy code
signIn: async function (input) {
  let resp = await oI.signIn(input); // where oI is original implementation
  // do something with resp
}
r
thanks! Will try this out
But I also need to get the origin of the request. Is it possible in function override?
r
You can override the associated API, set the request object in the userContext object and that will be available to you in the functions override
r
Hello ! I am working on customizing response from signIn function override . I want to add a new object in response . We get status, user from respose but i Want to send student details as well in response . How can I do that with typescript? Can we override the Type interface as well? if(resp.status === 'OK') { const student = await service.findByUserId(resp.user.id).then(student => { return student }) resp.user.student = student } I get error : Property 'student' does not exist on type 'User'.
r
It worked. Thanks!
r
Great