From 79948d9f8785842459d0be975fa10514f4dccbfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mih=C3=A1ly=20Lengyel?= Date: Mon, 25 Nov 2024 23:58:32 +0100 Subject: [PATCH 01/11] test: switch to mock provider (#866) * test: switch most thirdparty test to use mock provider * test: fix test errors --- examples/for-tests-react-16/src/App.js | 84 +++++++++-------- examples/for-tests/src/App.js | 93 ++++++++++--------- test/end-to-end/generalerror.test.js | 8 +- test/end-to-end/getRedirectionURL.test.js | 20 ++-- ...multitenancy.dynamic_login_methods.test.js | 3 +- test/end-to-end/thirdparty.test.js | 53 +++++------ .../thirdpartyemailpassword.test.js | 14 +-- .../end-to-end/thirdpartypasswordless.test.js | 8 +- .../thirdpartypasswordless.tp.test.js | 2 +- test/end-to-end/userContext.test.js | 3 +- test/helpers.js | 17 ++++ 11 files changed, 164 insertions(+), 141 deletions(-) diff --git a/examples/for-tests-react-16/src/App.js b/examples/for-tests-react-16/src/App.js index c772bbc9f..fdc197859 100644 --- a/examples/for-tests-react-16/src/App.js +++ b/examples/for-tests-react-16/src/App.js @@ -272,50 +272,52 @@ if (testContext.enableMFA) { ); } -SuperTokens.init({ - usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, - clientType: testContext.clientType, - appInfo: { - appName: "SuperTokens", - websiteDomain: getWebsiteDomain(), - apiDomain: getApiDomain(), - websiteBasePath, - }, - languageTranslations: { - translations: { - en: { - AUTH_PAGE_FOOTER_TOS: "TOS", - }, - hu: { - AUTH_PAGE_FOOTER_TOS: "ÁSZF", +if (!window.location.pathname.startsWith("/mockProvider")) { + SuperTokens.init({ + usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, + clientType: testContext.clientType, + appInfo: { + appName: "SuperTokens", + websiteDomain: getWebsiteDomain(), + apiDomain: getApiDomain(), + websiteBasePath, + }, + languageTranslations: { + translations: { + en: { + AUTH_PAGE_FOOTER_TOS: "TOS", + }, + hu: { + AUTH_PAGE_FOOTER_TOS: "ÁSZF", + }, }, }, - }, - getRedirectionURL: (context) => { - if (context.action === "SUCCESS") { - let logId = { - emailpassword: "EMAIL_PASSWORD", - thirdparty: "THIRD_PARTY", - passwordless: "PASSWORDLESS", - }[context.recipeId]; - - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); - setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); - if (testContext.disableRedirectionAfterSuccessfulSignInUp) { - return null; + getRedirectionURL: (context) => { + if (context.action === "SUCCESS") { + let logId = { + emailpassword: "EMAIL_PASSWORD", + thirdparty: "THIRD_PARTY", + passwordless: "PASSWORDLESS", + }[context.recipeId]; + + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); + setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); + if (testContext.disableRedirectionAfterSuccessfulSignInUp) { + return null; + } + return context.redirectToPath || "/dashboard"; + } else { + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); } - return context.redirectToPath || "/dashboard"; - } else { - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); - } - }, - useShadowDom, - privacyPolicyLink: "https://supertokens.com/legal/privacy-policy", - termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions", - defaultToSignUp, - disableAuthRoute: testContext.disableDefaultUI, - recipeList, -}); + }, + useShadowDom, + privacyPolicyLink: "https://supertokens.com/legal/privacy-policy", + termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions", + defaultToSignUp, + disableAuthRoute: testContext.disableDefaultUI, + recipeList, + }); +} /* App */ function App() { diff --git a/examples/for-tests/src/App.js b/examples/for-tests/src/App.js index 71c1d7ea3..53353cc73 100644 --- a/examples/for-tests/src/App.js +++ b/examples/for-tests/src/App.js @@ -439,55 +439,56 @@ if (testContext.enableMFA) { }) ); } - -SuperTokens.init({ - usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, - clientType: testContext.clientType, - enableDebugLogs: true, - appInfo: { - appName: "SuperTokens", - websiteDomain: getWebsiteDomain(), - apiDomain: getApiDomain(), - websiteBasePath, - }, - languageTranslations: { - translations: { - en: { - AUTH_PAGE_FOOTER_TOS: "TOS", - }, - hu: { - AUTH_PAGE_FOOTER_TOS: "ÁSZF", +if (!window.location.pathname.startsWith("/mockProvider")) { + SuperTokens.init({ + usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, + clientType: testContext.clientType, + enableDebugLogs: true, + appInfo: { + appName: "SuperTokens", + websiteDomain: getWebsiteDomain(), + apiDomain: getApiDomain(), + websiteBasePath, + }, + languageTranslations: { + translations: { + en: { + AUTH_PAGE_FOOTER_TOS: "TOS", + }, + hu: { + AUTH_PAGE_FOOTER_TOS: "ÁSZF", + }, }, }, - }, - getRedirectionURL: (context) => { - if (context.action === "SUCCESS") { - let logId = { - emailpassword: "EMAIL_PASSWORD", - thirdparty: "THIRD_PARTY", - passwordless: "PASSWORDLESS", - thirdpartypasswordless: "THIRDPARTYPASSWORDLESS", - thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD", - }[context.recipeId]; - - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); - setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); - if (testContext.disableRedirectionAfterSuccessfulSignInUp) { - return null; + getRedirectionURL: (context) => { + if (context.action === "SUCCESS") { + let logId = { + emailpassword: "EMAIL_PASSWORD", + thirdparty: "THIRD_PARTY", + passwordless: "PASSWORDLESS", + thirdpartypasswordless: "THIRDPARTYPASSWORDLESS", + thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD", + }[context.recipeId]; + + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); + setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); + if (testContext.disableRedirectionAfterSuccessfulSignInUp) { + return null; + } + console.log(JSON.stringify(context)); + return context.redirectToPath || "/dashboard"; + } else { + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); } - console.log(JSON.stringify(context)); - return context.redirectToPath || "/dashboard"; - } else { - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); - } - }, - useShadowDom, - privacyPolicyLink: "https://supertokens.com/legal/privacy-policy", - termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions", - defaultToSignUp, - disableAuthRoute: testContext.disableDefaultUI, - recipeList, -}); + }, + useShadowDom, + privacyPolicyLink: "https://supertokens.com/legal/privacy-policy", + termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions", + defaultToSignUp, + disableAuthRoute: testContext.disableDefaultUI, + recipeList, + }); +} /* App */ function App() { diff --git a/test/end-to-end/generalerror.test.js b/test/end-to-end/generalerror.test.js index 1100c0150..228472f4a 100644 --- a/test/end-to-end/generalerror.test.js +++ b/test/end-to-end/generalerror.test.js @@ -37,7 +37,7 @@ import { assertProviders, clickOnProviderButton, clickOnProviderButtonWithoutWaiting, - loginWithAuth0, + loginWithMockProvider, isGeneralErrorSupported, setGeneralErrorToLocalStorage, backendBeforeEach, @@ -403,7 +403,7 @@ function getThirdPartyTests(rid, ridForStorage) { await assertProviders(page); let [_, response1] = await Promise.all([ - clickOnProviderButtonWithoutWaiting(page, "Auth0"), + clickOnProviderButtonWithoutWaiting(page, "Mock Provider"), page.waitForResponse( (response) => response.url().includes(GET_AUTH_URL_API) && @@ -428,10 +428,10 @@ function getThirdPartyTests(rid, ridForStorage) { await page.goto(`${TEST_CLIENT_BASE_URL}/auth`); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); let [_, response1] = await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); diff --git a/test/end-to-end/getRedirectionURL.test.js b/test/end-to-end/getRedirectionURL.test.js index f491f7ad9..77efb1cf4 100644 --- a/test/end-to-end/getRedirectionURL.test.js +++ b/test/end-to-end/getRedirectionURL.test.js @@ -7,7 +7,7 @@ import { screenshotOnFailure, assertProviders, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, setPasswordlessFlowType, waitForSTElement, getPasswordlessDevice, @@ -114,9 +114,9 @@ describe("getRedirectionURL Tests", function () { page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); @@ -170,9 +170,9 @@ describe("getRedirectionURL Tests", function () { it("Test that isNewRecipeUser works correctly when signing up with auth 0", async function () { await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); @@ -354,9 +354,9 @@ describe("getRedirectionURL Tests", function () { page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); @@ -642,10 +642,10 @@ describe("getRedirectionURL Tests", function () { ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse( (response) => response.url() === SIGN_IN_UP_API && response.status() === 200 ), @@ -654,7 +654,7 @@ describe("getRedirectionURL Tests", function () { const urlAfterSignUp = await page.url(); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); assert.equal(newUserCheck, "thirdparty-true"); - assert(urlAfterSignUp.includes("/auth/callback/auth0")); + assert(urlAfterSignUp.includes("/auth/callback/mock-provider")); }); }); }); diff --git a/test/end-to-end/multitenancy.dynamic_login_methods.test.js b/test/end-to-end/multitenancy.dynamic_login_methods.test.js index 6364161fd..303235eb9 100644 --- a/test/end-to-end/multitenancy.dynamic_login_methods.test.js +++ b/test/end-to-end/multitenancy.dynamic_login_methods.test.js @@ -34,13 +34,14 @@ import { loginWithGoogle, clearBrowserCookiesWithoutAffectingConsole, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, isMultitenancySupported, isMultitenancyManagementEndpointsSupported, setupTenant, backendBeforeEach, getTextByDataSupertokens, setupBrowser, + loginWithAuth0, } from "../helpers"; import { TEST_CLIENT_BASE_URL, diff --git a/test/end-to-end/thirdparty.test.js b/test/end-to-end/thirdparty.test.js index 49411419b..0a2d131ef 100644 --- a/test/end-to-end/thirdparty.test.js +++ b/test/end-to-end/thirdparty.test.js @@ -26,7 +26,7 @@ import { assertNoSTComponents, generateState, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, getGeneralError, waitFor, screenshotOnFailure, @@ -34,6 +34,7 @@ import { backendBeforeEach, waitForUrl, setupBrowser, + loginWithAuth0, } from "../helpers"; import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants"; @@ -137,37 +138,37 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs, ]); }); - it("Successful sign in with Auth0 with redirectToPath (w/ leading slash) keeping query params", async function () { + it("Successful sign in with redirectToPath (w/ leading slash) keeping query params", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=%2Fredirect-here%3Ffoo%3Dbar`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search, "/redirect-here?foo=bar"); }); - it("Successful sign in with Auth0 with redirectToPath (w/o leading slash) keeping query params", async function () { + it("Successful sign in with SSO with redirectToPath (w/o leading slash) keeping query params", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=%3Ffoo%3Dbar`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search, "/?foo=bar"); }); - it("Successful sign in with Auth0 with redirectToPath (query params + fragment)", async function () { + it("Successful sign in with SSO with redirectToPath (query params + fragment)", async function () { await Promise.all([ page.goto( `${TEST_CLIENT_BASE_URL}/auth?redirectToPath=${encodeURIComponent( @@ -177,39 +178,39 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs, page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search, hash } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search + hash, "/redirect-here?foo=bar#cell=4,1-6,2"); }); - it("Successful sign in with Auth0 with redirectToPath (only fragment)", async function () { + it("Successful sign in with SSO with redirectToPath (only fragment)", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=${encodeURIComponent("#cell=4,1-6,2")}`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search, hash } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search + hash, "/#cell=4,1-6,2"); }); - it("Successful signin with Auth0 and email verification", async function () { + it("Successful signin with SSO and email verification", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?mode=REQUIRED`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await page.waitForSelector(".sessionInfo-user-id"); @@ -241,29 +242,29 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs, ]); }); - it("Successful signin with auth0 and redirectToPath", async function () { + it("Successful signin with SSO and redirectToPath", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=/hello`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await waitForUrl(page, "/hello"); }); - it("Successful signin with auth0 and redirectToPath case sensitive", async function () { + it("Successful signin with SSO and redirectToPath case sensitive", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=%2FCasE%2FCase-SensItive1-PAth`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await waitForUrl(page, "/CasE/Case-SensItive1-PAth"); @@ -354,8 +355,8 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs, } }; page.on("request", requestHandler); - await clickOnProviderButton(page, "Auth0"); - await loginWithAuth0(page); + await clickOnProviderButton(page, "Mock Provider"); + await loginWithMockProvider(page); const error = await getGeneralError(page); assert.deepStrictEqual(error, "TOS"); }); @@ -390,8 +391,8 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs, }; page.on("request", requestHandler); - await clickOnProviderButton(page, "Auth0"); - await loginWithAuth0(page); + await clickOnProviderButton(page, "Mock Provider"); + await loginWithMockProvider(page); const error = await getGeneralError(page); assert.deepStrictEqual(error, "Test message!!!!"); diff --git a/test/end-to-end/thirdpartyemailpassword.test.js b/test/end-to-end/thirdpartyemailpassword.test.js index fb4bdef59..d4a9660a3 100644 --- a/test/end-to-end/thirdpartyemailpassword.test.js +++ b/test/end-to-end/thirdpartyemailpassword.test.js @@ -29,7 +29,7 @@ import { getLogoutButton, signUp, toggleSignInSignUp, - loginWithAuth0, + loginWithMockProvider, getLoginWithRedirectToSignIn, getLoginWithRedirectToSignUp, getAuthPageHeaderText, @@ -284,11 +284,11 @@ describe("SuperTokens Third Party Email Password", function () { await waitForSTElement(page, "[data-supertokens~=generalError]", true); }); - it("Successful signin/up with auth0", async function () { + it("Successful signin/up", async function () { await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await page.waitForSelector(".sessionInfo-user-id"); @@ -339,10 +339,10 @@ describe("SuperTokens Third Party Email Password", function () { await Promise.all([await logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]); await waitForUrl(page, "/auth"); - // 2. Sign in with auth0 with same address. - await clickOnProviderButton(page, "Auth0"); + // 2. Sign in with SSO with same address. + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await waitForUrl(page, "/dashboard"); diff --git a/test/end-to-end/thirdpartypasswordless.test.js b/test/end-to-end/thirdpartypasswordless.test.js index d97f74d34..36e0376eb 100644 --- a/test/end-to-end/thirdpartypasswordless.test.js +++ b/test/end-to-end/thirdpartypasswordless.test.js @@ -24,7 +24,7 @@ import { clickOnProviderButton, getUserIdWithFetch, getLogoutButton, - loginWithAuth0, + loginWithMockProvider, setInputValues, submitForm, waitForSTElement, @@ -139,10 +139,10 @@ describe("SuperTokens Third Party Passwordless", function () { await waitForSTElement(page, `input[name=email]`); - // 3. Sign in with auth0 with same address. - await clickOnProviderButton(page, "Auth0"); + // 3. Sign in with SSO with same address. + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await Promise.all([page.waitForSelector(".sessionInfo-user-id"), page.waitForNetworkIdle()]); diff --git a/test/end-to-end/thirdpartypasswordless.tp.test.js b/test/end-to-end/thirdpartypasswordless.tp.test.js index c0cb7f139..4d919cde0 100644 --- a/test/end-to-end/thirdpartypasswordless.tp.test.js +++ b/test/end-to-end/thirdpartypasswordless.tp.test.js @@ -24,7 +24,7 @@ import { clickOnProviderButton, getUserIdWithFetch, getLogoutButton, - loginWithAuth0, + loginWithMockProvider, setInputValues, submitForm, waitForSTElement, diff --git a/test/end-to-end/userContext.test.js b/test/end-to-end/userContext.test.js index 2a5e120f8..91b6a16e7 100644 --- a/test/end-to-end/userContext.test.js +++ b/test/end-to-end/userContext.test.js @@ -23,10 +23,11 @@ import { submitFormReturnRequestAndResponse, assertProviders, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, backendBeforeEach, waitForUrl, setupBrowser, + loginWithAuth0, } from "../helpers"; import { TEST_CLIENT_BASE_URL, diff --git a/test/helpers.js b/test/helpers.js index c9ddfeb08..2473c15a1 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -624,6 +624,23 @@ export async function loginWithFacebook(page) { await Promise.all([page.keyboard.press("Enter"), page.waitForNavigation({ waitUntil: "networkidle0" })]); } +export async function loginWithMockProvider( + page, + email = "st_test_user@supertokens.io", + userId = "123", + isVerified = true +) { + const url = new URL(page.url()); + await Promise.all([ + page.goto( + `${TEST_CLIENT_BASE_URL}/auth/callback/mock-provider?code=asdf&email=${encodeURIComponent( + email + )}&userId=${encodeURIComponent(userId)}&isVerified=${isVerified}&state=${url.searchParams.get("state")}` + ), + page.waitForNavigation({ waitUntil: "networkidle0" }), + ]); +} + export async function loginWithAuth0(page) { await page.focus("input[type=email]"); await page.keyboard.type(process.env.AUTH0_EMAIL); From 3eedb6f4636f304918893ac4452e4e816ecdbdd6 Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Tue, 26 Nov 2024 01:08:51 +0100 Subject: [PATCH 02/11] chore: bump version to allow devTag --- lib/build/genericComponentOverrideContext.js | 2 +- lib/build/version.d.ts | 2 +- lib/ts/version.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/build/genericComponentOverrideContext.js b/lib/build/genericComponentOverrideContext.js index c488e0ce2..75c31be25 100644 --- a/lib/build/genericComponentOverrideContext.js +++ b/lib/build/genericComponentOverrideContext.js @@ -266,7 +266,7 @@ var SSR_ERROR = * License for the specific language governing permissions and limitations * under the License. */ -var package_version = "0.48.0"; +var package_version = "0.48.1"; /* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. * diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index 102f68d86..311c90add 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1 +1 @@ -export declare const package_version = "0.48.0"; +export declare const package_version = "0.48.1"; diff --git a/lib/ts/version.ts b/lib/ts/version.ts index 41f9ac37a..7280b0411 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,4 +12,4 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const package_version = "0.48.0"; +export const package_version = "0.48.1"; diff --git a/package-lock.json b/package-lock.json index 994915e4b..5f919ebe0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-auth-react", - "version": "0.48.0", + "version": "0.48.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-auth-react", - "version": "0.48.0", + "version": "0.48.1", "license": "Apache-2.0", "dependencies": { "intl-tel-input": "^17.0.19", diff --git a/package.json b/package.json index de18ca401..39355b4ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-auth-react", - "version": "0.48.0", + "version": "0.48.1", "description": "ReactJS SDK that provides login functionality with SuperTokens.", "main": "./index.js", "engines": { From f5b53b511a0e1986bbb7789e77498f57dc38c033 Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Tue, 26 Nov 2024 01:10:07 +0100 Subject: [PATCH 03/11] adding dev-v0.48.1 tag to this commit to ensure building --- docs/classes/index.default.html | 2 +- docs/classes/recipe_authRecipe.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 2 +- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_multifactorauth.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_oauth2provider.default.html | 6 +++--- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_recipeModule.default.html | 2 +- docs/classes/recipe_session.BooleanClaim.html | 2 +- docs/classes/recipe_session.PrimitiveArrayClaim.html | 2 +- docs/classes/recipe_session.PrimitiveClaim.html | 2 +- docs/classes/recipe_session.default.html | 2 +- docs/classes/recipe_thirdparty.ActiveDirectory.html | 2 +- docs/classes/recipe_thirdparty.Apple.html | 2 +- docs/classes/recipe_thirdparty.Bitbucket.html | 2 +- docs/classes/recipe_thirdparty.BoxySAML.html | 2 +- docs/classes/recipe_thirdparty.Discord.html | 2 +- docs/classes/recipe_thirdparty.Facebook.html | 2 +- docs/classes/recipe_thirdparty.Github.html | 2 +- docs/classes/recipe_thirdparty.Gitlab.html | 2 +- docs/classes/recipe_thirdparty.Google.html | 2 +- docs/classes/recipe_thirdparty.GoogleWorkspaces.html | 2 +- docs/classes/recipe_thirdparty.LinkedIn.html | 2 +- docs/classes/recipe_thirdparty.Okta.html | 2 +- docs/classes/recipe_thirdparty.Twitter.html | 2 +- docs/classes/recipe_thirdparty.default.html | 2 +- docs/classes/recipe_totp.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 4 ++-- docs/modules/recipe_multifactorauth.html | 2 +- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_oauth2provider.html | 2 +- docs/modules/recipe_passwordless.html | 4 ++-- docs/modules/recipe_session.html | 4 ++-- docs/modules/recipe_thirdparty.html | 4 ++-- docs/modules/recipe_totp.html | 2 +- 39 files changed, 46 insertions(+), 46 deletions(-) diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index c49bba250..cbd55ea41 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: UserContext }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => UserContext) = useUserContext

Type declaration

    • (): UserContext
    • Returns UserContext

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { navigate?: Navigate; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup"; userContext?: UserContext }): Promise<void>
  • Parameters

    • Optional options: { navigate?: Navigate; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup"; userContext?: UserContext }
      • Optional navigate?: Navigate
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"
      • Optional userContext?: UserContext

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

SuperTokensWrapper: FC<PropsWithChildren<{ userContext?: UserContext }>> = SuperTokensWrapper
useTranslation: (() => TranslationFunc) = useTranslation

Type declaration

    • (): TranslationFunc
    • Returns TranslationFunc

useUserContext: (() => UserContext) = useUserContext

Type declaration

    • (): UserContext
    • Returns UserContext

Methods

  • changeLanguage(language: string): Promise<void>
  • init(config: SuperTokensConfig): void
  • loadTranslation(store: TranslationStore): void
  • redirectToAuth(options?: { navigate?: Navigate; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup"; userContext?: UserContext }): Promise<void>
  • Parameters

    • Optional options: { navigate?: Navigate; queryParams?: any; redirectBack?: boolean; show?: "signin" | "signup"; userContext?: UserContext }
      • Optional navigate?: Navigate
      • Optional queryParams?: any
      • Optional redirectBack?: boolean
      • Optional show?: "signin" | "signup"
      • Optional userContext?: UserContext

    Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_authRecipe.default.html b/docs/classes/recipe_authRecipe.default.html index c1b48562e..93d5c4ca5 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T, Action, R | OnHandleEventContext>

Hierarchy

  • default<T, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
firstFactorIds: string[]
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: UserContext }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(_context: T): Promise<string>
  • getDefaultRedirectionURL(_: NormalisedGetRedirectionURLContext<T>, _userContext: UserContext): Promise<string>
  • getFirstFactorsForAuthPage(): string[]
  • getRedirectUrl(context: NormalisedGetRedirectionURLContext<GetRedirectionURLContextType>, userContext: UserContext): Promise<null | string>
  • redirect(context: NormalisedGetRedirectionURLContext<GetRedirectionURLContextType>, navigate: undefined | Navigate, queryParams?: Record<string, string>, userContext?: UserContext): Promise<void>
  • Parameters

    • context: NormalisedGetRedirectionURLContext<GetRedirectionURLContextType>
    • navigate: undefined | Navigate
    • Optional queryParams: Record<string, string>
    • Optional userContext: UserContext

    Returns Promise<void>

  • signOut(input?: { userContext?: UserContext }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Property
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<T, Action, R, N> Abstract

Type Parameters

  • T

  • Action

  • R

  • N extends NormalisedConfig<T, Action, R | OnHandleEventContext>

Hierarchy

  • default<T, Action, R | OnHandleEventContext, N>
    • default

Index

Constructors

  • new default<T, Action, R, N>(config: NormalisedConfigWithAppInfoAndRecipeID<N>): default<T, Action, R, N>

Properties

config: NormalisedConfigWithAppInfoAndRecipeID<N>
firstFactorIds: string[]
recipeID: string

Methods

  • doesSessionExist(input?: { userContext?: UserContext }): Promise<boolean>
  • getAuthRecipeDefaultRedirectionURL(_context: T): Promise<string>
  • getDefaultRedirectionURL(_: NormalisedGetRedirectionURLContext<T>, _userContext: UserContext): Promise<string>
  • getFirstFactorsForAuthPage(): string[]
  • getRedirectUrl(context: NormalisedGetRedirectionURLContext<GetRedirectionURLContextType>, userContext: UserContext): Promise<null | string>
  • redirect(context: NormalisedGetRedirectionURLContext<GetRedirectionURLContextType>, navigate: undefined | Navigate, queryParams?: Record<string, string>, userContext?: UserContext): Promise<void>
  • Parameters

    • context: NormalisedGetRedirectionURLContext<GetRedirectionURLContextType>
    • navigate: undefined | Navigate
    • Optional queryParams: Record<string, string>
    • Optional userContext: UserContext

    Returns Promise<void>

  • signOut(input?: { userContext?: UserContext }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Property
  • Method
  • Inherited property
  • Inherited method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailpassword.default.html b/docs/classes/recipe_emailpassword.default.html index 03ac75c76..26da04256 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getResetPasswordTokenFromURL(input?: { userContext?: UserContext }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

  • signIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional shouldTryLinkingWithSessionUser?: boolean
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

  • signOut(input?: { userContext?: UserContext }): Promise<void>
  • signUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional shouldTryLinkingWithSessionUser?: boolean
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

  • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • Parameters

    • input: { email: string; options?: RecipeFunctionOptions; userContext?: UserContext }
      • email: string
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

  • getResetPasswordTokenFromURL(input?: { userContext?: UserContext }): string
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" | "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

  • signIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional shouldTryLinkingWithSessionUser?: boolean
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

  • signOut(input?: { userContext?: UserContext }): Promise<void>
  • signUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; shouldTryLinkingWithSessionUser?: boolean; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional shouldTryLinkingWithSessionUser?: boolean
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

  • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: UserContext }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html index 490029706..cdc4ea60d 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: UserContext }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationRecipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: UserContext }): string
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multifactorauth.default.html b/docs/classes/recipe_multifactorauth.default.html index ee715fdaa..42bac57e7 100644 --- a/docs/classes/recipe_multifactorauth.default.html +++ b/docs/classes/recipe_multifactorauth.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
FactorIds: { EMAILPASSWORD: "emailpassword"; LINK_EMAIL: "link-email"; LINK_PHONE: "link-phone"; OTP_EMAIL: "otp-email"; OTP_PHONE: "otp-phone"; THIRDPARTY: "thirdparty"; TOTP: "totp" } = FactorIds

Type declaration

  • EMAILPASSWORD: "emailpassword"
  • LINK_EMAIL: "link-email"
  • LINK_PHONE: "link-phone"
  • OTP_EMAIL: "otp-email"
  • OTP_PHONE: "otp-phone"
  • THIRDPARTY: "thirdparty"
  • TOTP: "totp"
MultiFactorAuthClaim: MultiFactorAuthClaimClass = MultiFactorAuthRecipe.MultiFactorAuthClaim

Methods

  • redirectToFactor(input: { factorId: string; forceSetup?: boolean; navigate?: Navigate; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }): Promise<void>
  • Parameters

    • input: { factorId: string; forceSetup?: boolean; navigate?: Navigate; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }
      • factorId: string
      • Optional forceSetup?: boolean
      • Optional navigate?: Navigate
      • Optional redirectBack?: boolean
      • Optional stepUp?: boolean
      • Optional userContext?: UserContext

    Returns Promise<void>

  • redirectToFactorChooser(input: { navigate?: Navigate; nextFactorOptions?: string[]; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }): Promise<void>
  • Parameters

    • input: { navigate?: Navigate; nextFactorOptions?: string[]; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }
      • Optional navigate?: Navigate
      • Optional nextFactorOptions?: string[]
      • Optional redirectBack?: boolean
      • Optional stepUp?: boolean
      • Optional userContext?: UserContext

    Returns Promise<void>

  • resyncSessionAndFetchMFAInfo(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ emails: Record<string, undefined | string[]>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, undefined | string[]>; status: "OK" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ emails: Record<string, undefined | string[]>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, undefined | string[]>; status: "OK" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
FactorIds: { EMAILPASSWORD: "emailpassword"; LINK_EMAIL: "link-email"; LINK_PHONE: "link-phone"; OTP_EMAIL: "otp-email"; OTP_PHONE: "otp-phone"; THIRDPARTY: "thirdparty"; TOTP: "totp" } = FactorIds

Type declaration

  • EMAILPASSWORD: "emailpassword"
  • LINK_EMAIL: "link-email"
  • LINK_PHONE: "link-phone"
  • OTP_EMAIL: "otp-email"
  • OTP_PHONE: "otp-phone"
  • THIRDPARTY: "thirdparty"
  • TOTP: "totp"
MultiFactorAuthClaim: MultiFactorAuthClaimClass = MultiFactorAuthRecipe.MultiFactorAuthClaim

Methods

  • redirectToFactor(input: { factorId: string; forceSetup?: boolean; navigate?: Navigate; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }): Promise<void>
  • Parameters

    • input: { factorId: string; forceSetup?: boolean; navigate?: Navigate; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }
      • factorId: string
      • Optional forceSetup?: boolean
      • Optional navigate?: Navigate
      • Optional redirectBack?: boolean
      • Optional stepUp?: boolean
      • Optional userContext?: UserContext

    Returns Promise<void>

  • redirectToFactorChooser(input: { navigate?: Navigate; nextFactorOptions?: string[]; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }): Promise<void>
  • Parameters

    • input: { navigate?: Navigate; nextFactorOptions?: string[]; redirectBack?: boolean; stepUp?: boolean; userContext?: UserContext }
      • Optional navigate?: Navigate
      • Optional nextFactorOptions?: string[]
      • Optional redirectBack?: boolean
      • Optional stepUp?: boolean
      • Optional userContext?: UserContext

    Returns Promise<void>

  • resyncSessionAndFetchMFAInfo(input?: { options?: RecipeFunctionOptions; userContext?: UserContext }): Promise<{ emails: Record<string, undefined | string[]>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, undefined | string[]>; status: "OK" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: UserContext }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: UserContext

    Returns Promise<{ emails: Record<string, undefined | string[]>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, undefined | string[]>; status: "OK" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 0dfa51aa8..ae6b2e1f0 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

AllowedDomainsClaim: AllowedDomainsClaimClass = AllowedDomainsClaim
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • init(config?: UserInput): RecipeInitResult<any, any, any, any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_oauth2provider.default.html b/docs/classes/recipe_oauth2provider.default.html index 5c88673d2..5ec365c92 100644 --- a/docs/classes/recipe_oauth2provider.default.html +++ b/docs/classes/recipe_oauth2provider.default.html @@ -1,12 +1,12 @@ -default | supertokens-auth-react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider

Methods

  • getLoginChallengeInfo(input: { loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; info: LoginInfo; status: "OK" }>