when customizing the signup form, do we have the a...
# general
f
when customizing the signup form, do we have the ability to add a "dropdown" select box to the form fields?
n
Hi, Theres no straightforward way to do this at the moment, but maybe @porcellus can help with ideas of how to do this? (He'll be on later today)
f
thanks
p
hi, as @nkshah2 said, there is no simple way to do it right now, but you can use component overrides and the preAPIHook to achieve this.
I can go into more detail if you'd like but it's a bit more involved
f
sure, if you could
p
So, first you'd override the sign up component (https://supertokens.com/docs/emailpassword/advanced-customizations/react-component-override/usage): there are multiple ways to go about this, but it may be easiest to completely replace the
EmailPasswordSignUpForm
with your own form. If you didn't entirely replace the form, just added your own field, you need to add an
preAPIHook
(https://supertokens.com/docs/emailpassword/advanced-customizations/frontend-hooks/pre-api) and change the body to include your new field in the
formFields
prop of the body with the
id
and
value
of your field. Lastly, Step 2&3 apply from here: https://supertokens.com/docs/emailpassword/common-customizations/signup-form/adding-fields
f
thanks ill check it out
Ok, I'm trying to the signup component. In the docs it says
Copy code
EmailPasswordReact.init({
        signInAndUpFeature: {
          disableDefaultUI: true,
        },
        getRedirectionURL: async (context) => {
          console.log("Context: ", context);
          if (context.action === "TO_AUTH") {
            return "/sign-up-form";
          }
does this happen in the frontendConfig()? Also, the docs say
Copy code
context.action === "TO_AUTH"
but they're talking about the "SignIn" form. What's the context.action for signup? And is there a list of context.actions somewhere? I have not been able to find them in the docs