Search code examples
javascriptnode.jsstrapi

How Can i Implements 2FA(using OTP) in Strapi?


Is it Possible to Implements 2FA In Strapi? if yes then I want to Implements 2FA In My Strapi CMS How can I Do Anyone helps me.

I'm trying with that with lots of time.

But it's not working partially.

For frontend override it's work, but backend it does not work.

Exactly I Want to modify our admin /auth/local routes in https://github.com/strapi/strapi/blob/master/packages/strapi-admin/config/routes.json.

I want to add one extra check for recatch validation for handler: "Auth.callback" in https://github.com/strapi/strapi/blob/master/packages/strapi-admin/controllers/Auth.js


Solution

  • If you want to add this feature in your admin panel, you will have to customize it.

    To do so, you will have to use the customization concept

    https://strapi.io/documentation/3.0.0-beta.x/concepts/customization.html

    The Admin extension is the part you will have to use.

    https://github.com/strapi/strapi/tree/master/packages/strapi-admin/admin/src/containers/AuthPage

    After that, I suggest you add a new endpoint that will send a validate your code. You will have to check route and controller documentation.

    This is really similar to this question:

    Check Password in ContentType Controller

    Here is a video that could help you:

    https://www.loom.com/share/990d3f842ded4a879b27c0e77c5ac340