#Getting missing flow error

1 messages · Page 1 of 1 (latest)

past locustBOT
#

Hi @last vector. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The error message indicates that the Convex Auth Password provider is not receiving the required flow parameter, even though you are passing flow: "signUp" in your code.

This usually happens because the Password provider expects the parameters to be sent as a FormData object, not as a plain JavaScript object. When you use a plain object, the flow field may not be picked up correctly by the provider.

Solution:
Wrap your parameters in a FormData object before passing them to signIn. Here’s how you can do it:

onSubmit: async ({ value }) => {
  if (value.password !== value.confirmPassword) {
    toast.error("Passwords do not match");
    return;
  }
  setIsLoading(true);

  try {
    const formData = new FormData();
    formData.append("email", value.email);
    formData.append("password", value.password);
    formData.append("name", value.name);
    formData.append("flow", "signUp");

    await signIn("password", formData);
    console.log("Attempted to create user and sign in.");
    toast.success("Account created successfully!");
    router.push("/dashboard");
  } catch (error) {
    toast.error("Failed to create account. Please try again.");
    console.error("Sign up error:", error);
  } finally {
    setIsLoading(false);
  }
}

This approach matches the documented usage for Convex Auth’s Password provider, which expects a FormData object for the parameters, including the flow field. See the official example for reference:
Convex Auth Passwords: Add sign-in form
and
Convex Auth API Reference: signIn.

#

Summary:
Always use FormData when calling signIn with the Password provider to ensure all fields, especially flow, are correctly transmitted. This should resolve the "Missing flow param" error.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@last vector Kapa.ai is still learning and improving, please let me know how I did by reacting below.

last vector
#

@past locust Issue is not resolved..

past locustBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Based on the knowledge sources, the "Missing flow param" error occurs when the Password provider does not receive the required flow parameter, which must be one of "signUp", "signIn", "reset", "reset-verification", or "email-verification".

Key points from the sources:

  • The Convex Auth Password provider expects the parameters (including flow) to be sent as a FormData object, not as a plain JavaScript object. This is shown in the official documentation and community discussions, where the form submission handler always constructs a FormData and passes it to signIn:

    const formData = new FormData(event.currentTarget);
    void signIn("password", formData);
    

    See official docs

  • If you pass a plain object, the provider may not correctly receive the flow parameter, resulting in the error you are seeing.

  • Community members have confirmed that using FormData works, and that all required fields (including custom ones) must be present and match the schema if they are required. If you have required fields in your schema, ensure they are included in the FormData and in the profile callback of your provider config as well. If any required field is missing, you will get a schema validation error, not a missing flow error, but both can be confused if the data is not passed as expected Discord thread.

What to do:

  • Ensure you are passing a FormData object to signIn, not a plain object.
  • Make sure the flow field is included in the FormData and set to "signUp" for sign-up.

Example:

#
onSubmit={async (event) => {
  event.preventDefault();
  const formData = new FormData(event.currentTarget);
  // formData must include "flow" with value "signUp"
  await signIn("password", formData);
}}

Reference: Convex Auth Passwords - Add sign-in form

If you are already using FormData and still seeing this error, double-check that the flow field is actually present in the FormData at the time of submission. You can log the contents of your FormData to verify.

If you are using a form library that does not use a native <form> element, you may need to manually construct a FormData object and append all fields, including flow, before passing it to signIn.

If you are already doing all of the above and the issue persists, the knowledge sources do not provide further troubleshooting steps for this specific error. In that case, please provide more details about how you are constructing and passing the data to signIn, or consider enabling debug logging as suggested in the community threads to get more information from the Convex logs Discord thread.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: