Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test for mfa feature and update existing tests #773

Merged
merged 118 commits into from
Dec 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
26d1e48
chore: update to mfa branch of web-js
porcellus Oct 12, 2023
db3be18
feat: mfa recipe setup
porcellus Oct 13, 2023
8b339a4
feat: add support for firstFactor
porcellus Oct 13, 2023
02429f8
fix: fix chooseComponentBasedOnFirstFactors to properly get the max c…
porcellus Oct 15, 2023
f3c955e
feat: navigation based on claim validation failures
porcellus Oct 16, 2023
8932a0e
feat: implement factor chooser screen
porcellus Oct 16, 2023
ad99b5f
feat: factor chooser fixes and updates
porcellus Oct 19, 2023
083e908
feat: update pwless to support otp based mfa
porcellus Oct 19, 2023
f7c710b
feat: initial impl of totp mfa
porcellus Oct 22, 2023
9174480
feat: export totp bundle
porcellus Oct 25, 2023
f9b13c3
feat: finish TOTP + test setup WIP
porcellus Oct 26, 2023
9b8e063
feat: finish TOTP + test setup WIP
porcellus Oct 26, 2023
e61dd45
feat: add back button to factor chooser and filter the options
porcellus Oct 30, 2023
1114c60
Merge remote-tracking branch 'origin/feat/mfa/recipe-setup' into feat…
porcellus Oct 30, 2023
b589515
feat: update how back buttons are styled
porcellus Oct 30, 2023
85b1c4d
test: update how back button is selected in tests
porcellus Oct 30, 2023
4b1bd32
Merge remote-tracking branch 'origin/feat/mfa/recipe-setup' into feat…
porcellus Oct 30, 2023
3dd7c52
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Oct 30, 2023
f17de3a
feat: finishing totp initial impl
porcellus Oct 30, 2023
b8b3e3c
test: initial test for MFA
porcellus Oct 30, 2023
a9ce3b5
feat: self-review fixes & updates
porcellus Oct 31, 2023
c62fd92
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Oct 31, 2023
fa3d6d5
feat: self-review fixes&cleanup
porcellus Oct 31, 2023
068d687
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Oct 31, 2023
ca49aee
feat: self-review fixes&cleanup
porcellus Oct 31, 2023
ce5e615
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Oct 31, 2023
c11f185
test: add firstFactors tests
porcellus Oct 31, 2023
acfecc8
tests: complete initial test-set of MFA
porcellus Nov 6, 2023
3deb3cd
fix: firstFactors + test helpers
porcellus Nov 6, 2023
9653c1b
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Nov 6, 2023
8e231ae
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 6, 2023
6b84340
fix: small test based fixes
porcellus Nov 6, 2023
8129ef0
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 6, 2023
1ec993a
feat: finishing touches
porcellus Nov 6, 2023
3f48569
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 6, 2023
7ead9c6
test: update first factor tests to match new behaviour w/ extra checks
porcellus Nov 7, 2023
7355f50
feat: clean up first factor handling
porcellus Nov 7, 2023
e66c584
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Nov 7, 2023
61da851
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 7, 2023
0b2b35e
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 7, 2023
1da8517
feat: add retry info to verifyCode/Device
porcellus Nov 9, 2023
fb89c18
refactor: rename passwordlessFirstFactors since it's not only first f…
porcellus Nov 9, 2023
23e6a46
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 9, 2023
f159c84
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 9, 2023
792316b
feat: self-review fixes
porcellus Nov 9, 2023
f45271c
chore: add mfa ui to size limits
porcellus Nov 9, 2023
1990358
refactor: remove updates that will be added in other PRs + simplifica…
porcellus Nov 9, 2023
666d3fb
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Nov 9, 2023
5ad586e
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 9, 2023
8b44d6b
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 9, 2023
60e0cbb
test: clean up
porcellus Nov 9, 2023
46ae327
chore: increase size limits
porcellus Nov 9, 2023
150c9ad
test: add reset method to mfa recipe
porcellus Nov 9, 2023
b1203cf
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Nov 9, 2023
897f900
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 9, 2023
ba6621e
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 9, 2023
907930e
feat: make sure firstFactor conflicts hit user error boundaries
porcellus Nov 13, 2023
fbd63e4
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 13, 2023
ae7ee82
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 13, 2023
f84d9b8
feat: update design and fix font-weight issues
porcellus Nov 15, 2023
ea768d1
chore: update web-js dep
porcellus Nov 15, 2023
a9b010f
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Nov 15, 2023
598be73
feat: update design
porcellus Nov 15, 2023
a774c13
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 15, 2023
be04faa
feat: update design
porcellus Nov 15, 2023
d1f615f
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 15, 2023
a4c0095
refactor: self-review fixes
porcellus Nov 16, 2023
b397c67
refactor: self-review fixes
porcellus Nov 16, 2023
69a2110
chore: update changelog
porcellus Nov 16, 2023
4ecfc27
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 16, 2023
0d9ea8e
fix: revert unnecessary changes
porcellus Nov 16, 2023
abce472
feat: use redirect info if available on mfa success
porcellus Nov 16, 2023
00ee185
refactor: use redirectToFactor instead of re-implementing
porcellus Nov 16, 2023
7d8f419
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Nov 16, 2023
95bd42f
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 16, 2023
21dee6b
fix: add missing param into redirectToFactorChooser call
porcellus Nov 16, 2023
b520384
feat: self-review fixes
porcellus Nov 17, 2023
b483c83
chore: update changelog
porcellus Nov 17, 2023
51c7c4d
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Nov 17, 2023
78c2a96
test: update tests for MFA
porcellus Nov 21, 2023
3082073
test: skip mock mfa tests until removal
porcellus Nov 21, 2023
7891b73
fix: override and routing fixes
porcellus Nov 21, 2023
da4ac03
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Nov 21, 2023
8f35657
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Nov 21, 2023
405c419
Merge branch 'feat/mfa/tests' into feat/mfa/totp
porcellus Nov 21, 2023
9040500
test: update e2e test to work with an actual BE
porcellus Nov 27, 2023
ddc73be
fix: making sure async errors hit error boundaries + smaller test fixes
porcellus Dec 4, 2023
9d8fae1
feat: allow showing matching sub-recipe components if not on websiteb…
porcellus Dec 6, 2023
c0d686f
Merge branch 'feat/mfa/recipe-setup' into feat/mfa/otp
porcellus Dec 6, 2023
82aaef8
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Dec 6, 2023
758cca1
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Dec 6, 2023
acf8ab8
fix: auth server test
sattvikc Dec 7, 2023
2710ea5
test: ensure tests pass on older versions
porcellus Dec 10, 2023
07eb081
test: add missing case
porcellus Dec 10, 2023
fb74a61
Merge remote-tracking branch 'origin/feat/mfa/base' into feat/mfa/otp
porcellus Dec 10, 2023
ec913fb
fix: exposing mfa in tppwless + cleanup/refactor
porcellus Dec 10, 2023
4ce1591
Merge branch 'feat/mfa/otp' into feat/mfa/totp
porcellus Dec 10, 2023
0182e4b
Merge branch 'feat/mfa/totp' into feat/mfa/tests
porcellus Dec 10, 2023
4dcddb3
test: split up mfa tests into multiple files
porcellus Dec 10, 2023
457bfe4
Merge remote-tracking branch 'origin/feat/mfa/base' into feat/mfa/tests
porcellus Dec 11, 2023
bcba405
refactor: consistency fixes
porcellus Dec 11, 2023
1eb1505
docs: add storybook (#774)
porcellus Dec 11, 2023
c1f3a48
test: update tests to work w/ new BE behaviour
porcellus Dec 11, 2023
e865afc
fix: small self-review fixes
porcellus Dec 11, 2023
9a7a04e
fix: self-review fixes
porcellus Dec 11, 2023
e39c5ba
fix: add missing type to prebuiltuis
porcellus Dec 12, 2023
381124c
fix: fix console errors
porcellus Dec 12, 2023
ae18961
fix: small design and usability upgrades
porcellus Dec 14, 2023
322d83d
docs: update with-phone-password to use MFA
porcellus Dec 14, 2023
851b9b4
docs: remove 2fa examples and update the README to point to new mfa e…
porcellus Dec 14, 2023
a870d47
fix: add missing arg to redirectToFactorChooser
porcellus Dec 14, 2023
d9f812a
fix: add missing param
porcellus Dec 14, 2023
f75c9b3
fix: add missing param
porcellus Dec 14, 2023
fe49eb2
docs: add mfa example with recovery codes
porcellus Dec 15, 2023
5fe17b3
docs: save netlify-cli version in netlify example
porcellus Dec 15, 2023
677cdac
fix: mfa otp loading screen override
porcellus Dec 15, 2023
53ffd90
docs: add mfa-with-phone-chooser example
porcellus Dec 16, 2023
686e029
fix: remove duplicate type + rebuild
porcellus Dec 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: self-review fixes
  • Loading branch information
porcellus committed Dec 11, 2023
commit 9a7a04ecb43d1e8150c2cc9d60dc21d597024a8e
10 changes: 2 additions & 8 deletions lib/build/passwordless-shared4.js

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

11 changes: 2 additions & 9 deletions lib/ts/recipe/passwordless/components/features/mfa/index.tsx
Original file line number Diff line number Diff line change
@@ -34,10 +34,8 @@ import {
useRethrowInRender,
} from "../../../../../utils";
import MultiFactorAuth from "../../../../multifactorauth/recipe";
import { useDynamicLoginMethods } from "../../../../multitenancy/dynamicLoginMethodsContext";
import SessionRecipe from "../../../../session/recipe";
import { getPhoneNumberUtils } from "../../../phoneNumberUtils";
import { getEnabledContactMethods } from "../../../utils";
import MFAThemeWrapper from "../../themes/mfa";
import { defaultTranslationsPasswordless } from "../../themes/translations";

@@ -317,7 +315,7 @@ function useOnLoad(
() => dispatch({ type: "setError", error: "SOMETHING_WENT_WRONG_ERROR" }),
[dispatch]
);
const dynamicLoginMethods = useDynamicLoginMethods();

const onLoad = React.useCallback(
async (mfaInfo: { factors: MFAFactorInfo; email?: string; phoneNumber?: string }) => {
let error: string | undefined = undefined;
@@ -341,12 +339,7 @@ function useOnLoad(
? mfaInfo.factors.isAllowedToSetup.includes("otp-email")
: mfaInfo.factors.isAllowedToSetup.includes("otp-phone");

const enabledContactMethods = getEnabledContactMethods(
props.recipe.config.contactMethod,
dynamicLoginMethods
);

if (loginAttemptInfo && !enabledContactMethods.includes(loginAttemptInfo.contactMethod)) {
if (loginAttemptInfo && props.contactMethod !== loginAttemptInfo.contactMethod) {
await recipeImplementation?.clearLoginAttemptInfo({ userContext });
loginAttemptInfo = undefined;
}
Loading