https://supertokens.com/ logo
#support-questions
Title
# support-questions
b

bill92

02/03/2022, 12:49 AM
currently brainstorming
Copy code
ts
components: {
          PasswordlessUserInputCodeForm: () => {
            // logic here to enter the OTP and send it to the backend
            return <div></div>;
          },
          PasswordlessPhoneForm: ({ config, recipeImplementation }) => {
            const [phoneNumber, setPhoneNumber] = useState<string>("");
            return (
              <form
                onSubmit={async (e) => {
                  e.preventDefault();
                  window.alert(phoneNumber);
                  const isInvalid = await config.validatePhoneNumber(
                    phoneNumber
                  );
                  if (!isInvalid) {
                    // do something here, send the code
                  }
                }}
              >
                <label>phone number</label>
                <input
                  type='text'
                  value={phoneNumber}
                  onChange={(e) => setPhoneNumber(e.target.value)}
                />
                <button type='submit'>Send Code</button>
              </form>
            );
          },
        },