From fede7a92aee6bb78d4f34b8db8a93972c1a4bcaa Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Sat, 25 Nov 2023 09:41:56 +0530 Subject: [PATCH] fixes code snippet --- .../signup-form/adding-fields.mdx | 24 +++++++++---------- .../customising-each-form-field.mdx | 12 +++++----- .../nextjs/app-directory/session-helpers.mdx | 2 +- .../nextjs/app-directory/session-helpers.mdx | 2 +- .../nextjs/app-directory/session-helpers.mdx | 2 +- .../signup-form/adding-fields.mdx | 24 +++++++++---------- .../customising-each-form-field.mdx | 12 +++++----- .../nextjs/app-directory/session-helpers.mdx | 2 +- .../nextjs/app-directory/session-helpers.mdx | 2 +- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/v2/emailpassword/common-customizations/signup-form/adding-fields.mdx b/v2/emailpassword/common-customizations/signup-form/adding-fields.mdx index 26525ec0d..b79e34b18 100644 --- a/v2/emailpassword/common-customizations/signup-form/adding-fields.mdx +++ b/v2/emailpassword/common-customizations/signup-form/adding-fields.mdx @@ -36,23 +36,23 @@ Ensure that your Custom UI calls the following function with additional fields w ```tsx import { ^{webjsEmailPasswordSignUp} } from "supertokens-web-js/recipe/^{codeImportRecipeName}"; -async function signUpClicked(formData) { +async function signUpClicked(email: string, password: string, name: string, age: number, country: string) { let response = await ^{webjsEmailPasswordSignUp}({ formFields: [{ id: "email", - value: formData.email + value: email }, { id: "password", - value: formData.password + value: password },{ id: "name", - value: formData.name + value: name }, { id: "age", - value: formData.age + value: age + "" }, { id: "country", - value: formData.country + value: country }] }) // ... rest of the code @@ -64,23 +64,23 @@ async function signUpClicked(formData) { ```tsx import supertokens^{recipeNameCapitalLetters} from "supertokens-web-js-script/recipe/^{codeImportRecipeName}"; -async function signUpClicked(formData) { +async function signUpClicked(email: string, password: string, name: string, age: number, country: string) { let response = await supertokens^{recipeNameCapitalLetters}.^{webjsEmailPasswordSignUp}({ formFields: [{ id: "email", - value: formData.email + value: email }, { id: "password", - value: formData.password + value: password }, { id: "name", - value: formData.name + value: name }, { id: "age", - value: formData.age + value: age + "" }, { id: "country", - value: formData.country + value: country }] }) // ... rest of the code diff --git a/v2/emailpassword/common-customizations/signup-form/customising-each-form-field.mdx b/v2/emailpassword/common-customizations/signup-form/customising-each-form-field.mdx index 9c1aa3def..d7829720e 100644 --- a/v2/emailpassword/common-customizations/signup-form/customising-each-form-field.mdx +++ b/v2/emailpassword/common-customizations/signup-form/customising-each-form-field.mdx @@ -352,9 +352,9 @@ function App() { id === 'name'), - props.formFields.find(({id}) => id === 'email'), - props.formFields.find(({id}) => id === 'password'), + props.formFields.find(({id}) => id === 'name')!, + props.formFields.find(({id}) => id === 'email')!, + props.formFields.find(({id}) => id === 'password')!, ]} /> ); @@ -393,9 +393,9 @@ function App() { id === 'name'), - props.formFields.find(({id}) => id === 'email'), - props.formFields.find(({id}) => id === 'password'), + props.formFields.find(({id}) => id === 'name')!, + props.formFields.find(({id}) => id === 'email')!, + props.formFields.find(({id}) => id === 'password')!, ]} /> ); diff --git a/v2/emailpassword/nextjs/app-directory/session-helpers.mdx b/v2/emailpassword/nextjs/app-directory/session-helpers.mdx index f168b0b6a..75c1ad4a6 100644 --- a/v2/emailpassword/nextjs/app-directory/session-helpers.mdx +++ b/v2/emailpassword/nextjs/app-directory/session-helpers.mdx @@ -131,7 +131,7 @@ export async function withSession( ); } - baseResponse.headers.forEach((value, key) => { + baseResponse.headers.forEach((value: string, key: string) => { didAddHeaders = true; userResponse.headers.set(key, value); }); diff --git a/v2/passwordless/nextjs/app-directory/session-helpers.mdx b/v2/passwordless/nextjs/app-directory/session-helpers.mdx index f168b0b6a..75c1ad4a6 100644 --- a/v2/passwordless/nextjs/app-directory/session-helpers.mdx +++ b/v2/passwordless/nextjs/app-directory/session-helpers.mdx @@ -131,7 +131,7 @@ export async function withSession( ); } - baseResponse.headers.forEach((value, key) => { + baseResponse.headers.forEach((value: string, key: string) => { didAddHeaders = true; userResponse.headers.set(key, value); }); diff --git a/v2/thirdparty/nextjs/app-directory/session-helpers.mdx b/v2/thirdparty/nextjs/app-directory/session-helpers.mdx index f168b0b6a..75c1ad4a6 100644 --- a/v2/thirdparty/nextjs/app-directory/session-helpers.mdx +++ b/v2/thirdparty/nextjs/app-directory/session-helpers.mdx @@ -131,7 +131,7 @@ export async function withSession( ); } - baseResponse.headers.forEach((value, key) => { + baseResponse.headers.forEach((value: string, key: string) => { didAddHeaders = true; userResponse.headers.set(key, value); }); diff --git a/v2/thirdpartyemailpassword/common-customizations/signup-form/adding-fields.mdx b/v2/thirdpartyemailpassword/common-customizations/signup-form/adding-fields.mdx index cf2da5757..72476d109 100644 --- a/v2/thirdpartyemailpassword/common-customizations/signup-form/adding-fields.mdx +++ b/v2/thirdpartyemailpassword/common-customizations/signup-form/adding-fields.mdx @@ -38,23 +38,23 @@ Ensure that your Custom UI calls the following function with additional fields w ```tsx import { ^{webjsEmailPasswordSignUp} } from "supertokens-web-js/recipe/^{codeImportRecipeName}"; -async function signUpClicked(formData) { +async function signUpClicked(email: string, password: string, name: string, age: number, country: string) { let response = await ^{webjsEmailPasswordSignUp}({ formFields: [{ id: "email", - value: formData.email + value: email }, { id: "password", - value: formData.password + value: password },{ id: "name", - value: formData.name + value: name }, { id: "age", - value: formData.age + value: age + "" }, { id: "country", - value: formData.country + value: country }] }) // ... rest of the code @@ -66,23 +66,23 @@ async function signUpClicked(formData) { ```tsx import supertokens^{recipeNameCapitalLetters} from "supertokens-web-js-script/recipe/^{codeImportRecipeName}"; -async function signUpClicked(formData) { +async function signUpClicked(email: string, password: string, name: string, age: number, country: string) { let response = await supertokens^{recipeNameCapitalLetters}.^{webjsEmailPasswordSignUp}({ formFields: [{ id: "email", - value: formData.email + value: email }, { id: "password", - value: formData.password + value: password }, { id: "name", - value: formData.name + value: name }, { id: "age", - value: formData.age + value: age + "" }, { id: "country", - value: formData.country + value: country }] }) // ... rest of the code diff --git a/v2/thirdpartyemailpassword/common-customizations/signup-form/customising-each-form-field.mdx b/v2/thirdpartyemailpassword/common-customizations/signup-form/customising-each-form-field.mdx index 6f27b6f8f..8d45cc70a 100644 --- a/v2/thirdpartyemailpassword/common-customizations/signup-form/customising-each-form-field.mdx +++ b/v2/thirdpartyemailpassword/common-customizations/signup-form/customising-each-form-field.mdx @@ -352,9 +352,9 @@ function App() { id === 'name'), - props.formFields.find(({id}) => id === 'email'), - props.formFields.find(({id}) => id === 'password'), + props.formFields.find(({id}) => id === 'name')!, + props.formFields.find(({id}) => id === 'email')!, + props.formFields.find(({id}) => id === 'password')!, ]} /> ); @@ -393,9 +393,9 @@ function App() { id === 'name'), - props.formFields.find(({id}) => id === 'email'), - props.formFields.find(({id}) => id === 'password'), + props.formFields.find(({id}) => id === 'name')!, + props.formFields.find(({id}) => id === 'email')!, + props.formFields.find(({id}) => id === 'password')!, ]} /> ); diff --git a/v2/thirdpartyemailpassword/nextjs/app-directory/session-helpers.mdx b/v2/thirdpartyemailpassword/nextjs/app-directory/session-helpers.mdx index 154ca4e19..b331c41ee 100644 --- a/v2/thirdpartyemailpassword/nextjs/app-directory/session-helpers.mdx +++ b/v2/thirdpartyemailpassword/nextjs/app-directory/session-helpers.mdx @@ -131,7 +131,7 @@ export async function withSession( ); } - baseResponse.headers.forEach((value, key) => { + baseResponse.headers.forEach((value: string, key: string) => { didAddHeaders = true; userResponse.headers.set(key, value); }); diff --git a/v2/thirdpartypasswordless/nextjs/app-directory/session-helpers.mdx b/v2/thirdpartypasswordless/nextjs/app-directory/session-helpers.mdx index f168b0b6a..75c1ad4a6 100644 --- a/v2/thirdpartypasswordless/nextjs/app-directory/session-helpers.mdx +++ b/v2/thirdpartypasswordless/nextjs/app-directory/session-helpers.mdx @@ -131,7 +131,7 @@ export async function withSession( ); } - baseResponse.headers.forEach((value, key) => { + baseResponse.headers.forEach((value: string, key: string) => { didAddHeaders = true; userResponse.headers.set(key, value); });