Is there any equivalent to *signUpFeature* for signin? I'm trying to add a *token* form field for my...
n
Is there any equivalent to signUpFeature for signin? I'm trying to add a token form field for my CAPTCHA token, and this works fine for signup as I've added the validator in the backend override, but how do I do the same for signin?
r
Hey @n000dles
You can’t modify the formField for sign in at the moment. But you can use the preApiHook to modify the request body and add the token to that
And then read that token from the request body in the backend
n
Okay cool, considering that a new captcha token is generated on the frontend with every render, how can I pass the token along to the preApiHook to then be passed to the backend?
r
which frontend SDK are you using?
n
Web JS
r
the same style is applicable for other recipe functions as well
n
Oh I see. Alright, so let’s say my token is generated within login.tsx, how would I pass that same token to my frontend.ts file (where my frontend configuration is located), sorry if these are dumb-sounding questions, just trying to grasp a deeper understanding of this
r
where are you calling the supertokens web-js function? In login.tsx or in frontend.ts?
n
I'm calling signIn from login.tsx, but supertokens is initialized in frontend.ts
r
right. So you can add the preAPIHook to the sign in function itself
see the link above
it's calling createCode and to that function its giving the pre API hook. You can do a similar thing for the sign in function call too
n
Oh I see! That's helpful
Thank you for clarifying