born05 / craft-twofactorauthentication

Craft plugin for two-factor or two-step login using Time Based OTP.
MIT License
36 stars 26 forks source link

Front end form #2

Closed espensgr closed 6 years ago

espensgr commented 6 years ago

is it possible to use this for front end login forms?

roelvanhintum commented 6 years ago

Yes, the main logic is in services, which you could call from your own plugin. Users who have 2FA turned on will be redirected to the verification screen. For front-end users you would have to build templates which allow the user to turn on the 2FA.

roelvanhintum commented 6 years ago

@espensgr I've just added some screens to the readme give an impression of the admin interface. I imagine you need something similar on the front-end.

espensgr commented 6 years ago

nice! yeah i was hoping for some code documentations on what tags i can use in my templates so i can setup this on the front end, and the logic around it. Are that something you are planing to do?

roelvanhintum commented 6 years ago

Not right now, but you can take a look in the controllers and templates. I've kept the logic to a minimum, which would make it easy to copy for front-end usage.

Please be careful with logging in and the front-end. The plugin only protects the CP pages, so you need to write your own checks for handling that on the front-end. see: https://github.com/born05/craft-twofactorauthentication/blob/craft-2/TwoFactorAuthenticationPlugin.php#L56

edit: updated source link