DEV Community

Discussion on: Predictable React authentication with the Context API

jfranciscosousa profile image
Francisco Sousa Author

You can add a variable like needsMfa to the user returned in useAuth and use that to render the extra MFA step. I'd say it mostly depends on what the backend is using but you can add all that logic to useAuth relatively easy.

Just make sure your app renders the MFA form when the user is eligible for that.