Skip to content

Commit

Permalink
Merge branch 'feat/mfa/tests' into feat/mfa/storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Nov 9, 2023
2 parents cd10c4b + ba6621e commit e222df3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/build/multifactorauth-shared.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/build/recipe/multifactorauth/recipe.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion lib/ts/recipe/multifactorauth/recipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { SessionClaimValidatorStore } from "supertokens-web-js/utils/sessionClai

import { SSR_ERROR } from "../../constants";
import SuperTokens from "../../superTokens";
import { appendQueryParamsToURL, getCurrentNormalisedUrlPath, getRedirectToPathFromURL } from "../../utils";
import { appendQueryParamsToURL, getCurrentNormalisedUrlPath, getRedirectToPathFromURL, isTest } from "../../utils";
import RecipeModule from "../recipeModule";

import { DEFAULT_FACTOR_CHOOSER_PATH } from "./constants";
Expand Down Expand Up @@ -188,4 +188,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;
}
}

0 comments on commit e222df3

Please sign in to comment.