How to pass emailid in user context in passwordles...
# support-questions
p
How to pass emailid in user context in passwordless login? when I pass emailid - it comes empty curl 'http://localhost:3002/auth/signinup/code/consume' \ -H 'Connection: keep-alive' \ -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"' \ -H 'fdi-version: 1.8,1.9,1.10,1.11,1.12' \ -H 'Content-Type: application/json' \ -H 'rid: passwordless' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36' \ -H 'sec-ch-ua-platform: "macOS"' \ -H 'Accept: */*' \ -H 'Origin: http://localhost:3000' \ -H 'Sec-Fetch-Site: same-site' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Referer: http://localhost:3000/' \ -H 'Accept-Language: en-GB,en;q=0.9' \ -H 'Cookie: sIRTFrontend=remove' \ --data-raw '{"userInputCode":"802331","deviceId":"urowSmkumH6t5DI/VMayKmM2sHmJdmjbAda6X/+2f3c=","preAuthSessionId":"PzcQXtL9_yC9bPrQCb68Ys5vCRPQQIwJG7YEdnkMnm8=","userContext":{"email":"prachi@xyz.com"}}' \ --compressed
r
Hey! I don’t think I understand your question. Can you please elaborate?
p
sure, I want to know how to pass custom parameter in this api and access it in node sdk?
r
You can override the consume code API on the backend and get access to the request object to then read the custom param.
And in the function you provide, you can read the request object via
input.options.req.original
. That is the underlying express request object.
p
Thank you. I have overriden the API, and while passing email I am getting it in input.options.req.original.body.... but in the overriden function implementation of passwordless still email id is not present in input.
@User
r
Can you tell me which function(s) you are referring to exaclty?
p
In this I have overriden API to capture email, but in the function overriden call still no email is there in the input. This is my doubt.
r
Does
req.body
have the email field that you want
?
If it does, what do you want to do with the email field? Consume it in some other function? If yes, which function?
p
yes
r
Which function do you want to consume th email field in?
p
I want to consume the email field in passwordless(originalImpl)
while creating the new user , I want that field.
r
I see. So you can use the user context feature we have for this: https://supertokens.com/docs/passwordless/advanced-customizations/user-context
This will enable you to pass the custom email field from one function to another.
p
thank you
r
you're welcome.
3 Views