funk101
05/07/2022, 1:22 PMrecipeList: [
EmailPasswordNode.init({
signUpFeature: {
formFields: [
{
id: "firstname",
},
{
id: "lastname",
},
],
},
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
signUpPOST: async function (input) {
if (originalImplementation.signUpPOST === undefined) {
throw Error("Shouldn't come here");
}
try {
const response = await originalImplementation.signUpPOST(
input
);
console.log("Response: ", response);
if (response.status === "OK") {
const formFields = input.formFields;
console.log("FormFields: ", formFields);
}
} catch (err) {
console.log("Error: ", err.message);
}
return response;
},
};
},
},
}),
SessionNode.init(),
],
isInServerlessEnv: true,
rp
05/08/2022, 4:44 AMfunk101
05/08/2022, 5:41 AMrp
05/08/2022, 5:41 AMfunk101
05/08/2022, 5:42 AMexport const backendConfig = () => {
return {
framework: "express",
supertokens: {
connectionURI:
"https://54e49561ca4a11eca1c3c3ba0139426e-us-east-1.aws.supertokens.io:3567", //'https://try.supertokens.io',
apiKey: "[secret key]",
},
appInfo,
recipeList: [
EmailPasswordNode.init({
signUpFeature: {
formFields: [
{
id: "firstname",
},
{
id: "lastname",
},
],
},
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
signUpPOST: async function (input) {
if (originalImplementation.signUpPOST === undefined) {
throw Error("Shouldn't come here");
}
try {
const response = await originalImplementation.signUpPOST(
input
);
console.log("Response: ", response);
if (response.status === "OK") {
const formFields = input.formFields;
console.log("FormFields: ", formFields);
}
} catch (err) {
console.log("Error: ", err.message);
}
return response;
},
};
},
},
}),
SessionNode.init(),
],
isInServerlessEnv: true,
};
};
rp
05/08/2022, 5:43 AMfunk101
05/08/2022, 5:43 AMrp
05/08/2022, 5:43 AMfunk101
05/08/2022, 5:45 AMrp
05/08/2022, 6:07 AMfunk101
05/08/2022, 6:10 AMrp
05/08/2022, 6:10 AMfunk101
05/08/2022, 6:10 AMbody: { formFields: [Array] },
{"message":"Are you sending too many / too few formFields?"}
rp
05/08/2022, 6:13 AMfunk101
05/08/2022, 6:20 AMrp
05/08/2022, 6:21 AMfunk101
05/08/2022, 6:21 AMrp
05/08/2022, 6:21 AMfunk101
05/08/2022, 6:27 AMrp
05/10/2022, 4:09 AMfunk101
05/10/2022, 4:10 AMrecipeList: [
EmailPasswordReact.init({
signInAndUpFeature: {
signUpForm: {
formFields: [
{
id: "firstname",
label: "First Name",
placeholder: "Jane",
},
{
id: "lastname",
label: "Last Name",
placeholder: "Doe",
},
{
id: "phone",
label: "Phone",
placeholder: "(123)456-7890",
validate: (value) => {
return validatePhone(value);
},
},
],
},
},
rp
05/10/2022, 4:13 AMfunk101
05/10/2022, 4:13 AMrp
05/10/2022, 4:27 AMfunk101
05/10/2022, 4:27 AMrp
05/10/2022, 6:26 AMfunk101
05/10/2022, 6:26 AM