I am building the UI myself, when I create a user ...
# support-questions-legacy
k
I am building the UI myself, when I create a user with email and password, I want it to run a function using overrides. (I already have it done for 0Auth). So how can I do it for email and password signup?
Copy code
javascript
import axios from "axios";

const override = (originalImplementation) => {
  return {
    ...originalImplementation,

    thirdPartySignInUpPOST: async function (input) {
      if (originalImplementation.thirdPartySignInUpPOST === undefined) {
        throw Error("Should never come here");
      }

      let response = await originalImplementation.thirdPartySignInUpPOST(input);

      if (response.status === "OK") {
        if (response.createdNewUser) {
          axios({
            url: `${process.env.API_URL}/graphql`,
            method: "post",
            data: {
              query: `
                mutation CreateUser($userId: String!, $email: String!, $firstName: String!, $lastName: String!) {
                  createUser(userId: $userId, email: $email, firstName: $firstName, lastName: $lastName) {
                    userId
                    email
                    firstName
                    lastName
                  }
                }`,
              variables: {
                userId: response.user.id,
                email: response.user.email,
                firstName: "Killian",
                lastName: "",
              },
            },
          });
        }
      }

      return response;
    },
  };
};

export default override;
This is how I did it for 0Auth. So I can I ajust this for Email and Password?