arjun6436
09/03/2022, 3:54 PMrp_st
09/03/2022, 3:57 PMarjun6436
09/03/2022, 3:58 PMarjun6436
09/03/2022, 3:58 PMrp_st
09/03/2022, 3:59 PMarjun6436
09/03/2022, 4:01 PMrp_st
09/03/2022, 4:06 PMarjun6436
09/03/2022, 4:21 PMrp_st
09/03/2022, 4:24 PM{
_default: {
/*
This is the request object that allows you to read the body / origin / headers of the API request.
It is optional and will be defined only if the function you are overriding is called during an API.
*/
request
}
}
So you can do userContext._default.request
and the type of request is the BaseRequest class: https://github.com/supertokens/supertokens-node/blob/9dc46cec9d/lib/ts/framework/request.ts
So you can read headers using the getHeaderValue
function. I think the origin of the request should be in the "origin"
header name, but i don't remember of the top of my head.rp_st
09/03/2022, 4:26 PMrp_st
09/03/2022, 4:27 PMarjun6436
09/03/2022, 4:30 PMarjun6436
09/03/2022, 4:31 PMarjun6436
09/03/2022, 4:33 PMarjun6436
09/03/2022, 4:33 PMinput.userContext._default.request.getHeaderValue()
rp_st
09/03/2022, 4:33 PMarjun6436
09/03/2022, 4:33 PMrp_st
09/03/2022, 4:33 PMrp_st
09/03/2022, 4:33 PMarjun6436
09/03/2022, 4:33 PMarjun6436
09/03/2022, 4:33 PMarjun6436
09/03/2022, 4:33 PMarjun6436
09/03/2022, 4:33 PMrp_st
09/03/2022, 4:33 PMrp_st
09/03/2022, 4:34 PMarjun6436
09/03/2022, 4:45 PMrp_st
09/03/2022, 4:45 PMarjun6436
09/03/2022, 4:45 PM