diff --git a/lib/build/multifactorauth-shared.js b/lib/build/multifactorauth-shared.js index b81459a84..23669ebb0 100644 --- a/lib/build/multifactorauth-shared.js +++ b/lib/build/multifactorauth-shared.js @@ -371,6 +371,16 @@ var MultiFactorAuth = /** @class */ (function (_super) { }); }); }; + /* + * Tests methods. + */ + MultiFactorAuth.reset = function () { + if (!genericComponentOverrideContext.isTest()) { + return; + } + MultiFactorAuth.instance = undefined; + return; + }; var _a; _a = MultiFactorAuth; MultiFactorAuth.RECIPE_ID = "multifactorauth"; diff --git a/lib/build/recipe/multifactorauth/recipe.d.ts b/lib/build/recipe/multifactorauth/recipe.d.ts index 55556b1dd..14b5a0bba 100644 --- a/lib/build/recipe/multifactorauth/recipe.d.ts +++ b/lib/build/recipe/multifactorauth/recipe.d.ts @@ -37,4 +37,5 @@ export default class MultiFactorAuth extends RecipeModule< getSecondaryFactors(): SecondaryFactorRedirectionInfo[]; redirectToFactor(factorId: string, redirectBack?: boolean, history?: any): Promise; redirectToFactorChooser(redirectBack?: boolean, history?: any): Promise; + static reset(): void; } diff --git a/lib/ts/recipe/multifactorauth/recipe.tsx b/lib/ts/recipe/multifactorauth/recipe.tsx index 5caab85c9..d1f402779 100644 --- a/lib/ts/recipe/multifactorauth/recipe.tsx +++ b/lib/ts/recipe/multifactorauth/recipe.tsx @@ -25,7 +25,7 @@ import { SessionClaimValidatorStore } from "supertokens-web-js/utils/sessionClai import { SSR_ERROR } from "../../constants"; import SuperTokens from "../../superTokens"; -import { getCurrentNormalisedUrlPath, getRedirectToPathFromURL } from "../../utils"; +import { getCurrentNormalisedUrlPath, getRedirectToPathFromURL, isTest } from "../../utils"; import RecipeModule from "../recipeModule"; import { DEFAULT_FACTOR_CHOOSER_PATH } from "./constants"; @@ -193,4 +193,16 @@ export default class MultiFactorAuth extends RecipeModule< return SuperTokens.getInstanceOrThrow().redirectToUrl(url, history); } + + /* + * Tests methods. + */ + static reset(): void { + if (!isTest()) { + return; + } + + MultiFactorAuth.instance = undefined; + return; + } } diff --git a/package.json b/package.json index 6a54dd31b..6b7dc6478 100644 --- a/package.json +++ b/package.json @@ -119,15 +119,15 @@ "size-limit": [ { "path": "lib/build/index.js", - "limit": "15kb" + "limit": "17kb" }, { "path": "recipe/session/index.js", - "limit": "16kb" + "limit": "18kb" }, { "path": "recipe/session/prebuiltui.js", - "limit": "20kb" + "limit": "21kb" }, { "path": "recipe/thirdpartyemailpassword/index.js", @@ -155,27 +155,27 @@ }, { "path": "recipe/emailverification/prebuiltui.js", - "limit": "25kb" + "limit": "27kb" }, { "path": "recipe/thirdpartyemailpassword/prebuiltui.js", - "limit": "56kb" + "limit": "58kb" }, { "path": "recipe/thirdparty/prebuiltui.js", - "limit": "40kb" + "limit": "42kb" }, { "path": "recipe/emailpassword/prebuiltui.js", - "limit": "30kb" + "limit": "32kb" }, { "path": "recipe/passwordless/prebuiltui.js", - "limit": "107kb" + "limit": "110kb" }, { "path": "recipe/thirdpartypasswordless/prebuiltui.js", - "limit": "135kb" + "limit": "140kb" }, { "path": "recipe/multitenancy/index.js",