feat(mfa): add MFA flow integration example in mfa_flow.html#1040
feat(mfa): add MFA flow integration example in mfa_flow.html#1040gyaneshgouraw-okta wants to merge 1 commit intomainfrom
Conversation
| try { | ||
| var factorType = type === 'push-notification' ? 'push' : 'otp'; | ||
| const data = await mfa.enroll({ mfaToken, factorType: factorType }); | ||
| console.log(">>>>>>details push", data) |
Check notice
Code scanning / CodeQL
Semicolon insertion Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 9 days ago
In general, to avoid relying on ASI, terminate all JavaScript statements explicitly with semicolons, especially in codebases that otherwise consistently do so. This improves readability and avoids edge cases where line breaks change program behavior.
For this specific instance, the best fix is to add a terminating semicolon to the console.log statement inside the selectType function in static/mfa_flow.html. Only line 242 needs to change: turn console.log(">>>>>>details push", data) into console.log(">>>>>>details push", data);. No imports, additional methods, or other code changes are required, and this does not alter existing functionality.
| @@ -239,7 +239,7 @@ | ||
| try { | ||
| var factorType = type === 'push-notification' ? 'push' : 'otp'; | ||
| const data = await mfa.enroll({ mfaToken, factorType: factorType }); | ||
| console.log(">>>>>>details push", data) | ||
| console.log(">>>>>>details push", data); | ||
| setEnrollmentData(data); | ||
| } catch (e) { | ||
| setError(e.message || e.error_description || String(e)); |
Summary
Add an interactive MFA APIs playground page that lets developers test the full Auth0 MFA flow — enrollment, challenge, and verification — directly from a single HTML file using
auth0-react.Changes
auth0-reactvia CDN/local bundleTesting
static/mfa_flow.htmlin a browser (withauth0-react.jsbuilt alongside it)