d8-contrib-modules / tfa

DEPRECATED - D8 TFA port now on drupal.org
https://www.drupal.org/project/tfa
5 stars 11 forks source link

Use EventDispatcher in the EntryForm submitForm #29

Closed dragos-dumi closed 8 years ago

dragos-dumi commented 8 years ago

I'm not familiar with all new things in 8, but I was wondering if we should use in submitForm event dispatcher instead of calling plugin methods.

Could this be used in a way in building or validating form? (I guess not)

nerdstein commented 8 years ago

I see what you are doing now in https://github.com/d8-contrib-modules/tfa/pull/27. I think it is fine and I'm going to merge it in. I think we can iterate on it.

To answer your question, I'm not 100% sure. I use a very similar implementation for Password Policy, where I embed the specific constraint configuration into a form. You can see the code here: http://cgit.drupalcode.org/password_policy/tree/src/Form/ConstraintEdit.php?h=8.x-3.x

therealssj commented 8 years ago

I just have one doubt. How do you plan to handle fallbacks while using EventDispatcher? Let say I have the following structure: 1) TOTP (Default Validation) 2) Recovery Codes (Fallback 1) 3) Twilio SMS (Fallback 2) 4) Help (Final fallback)

nerdstein commented 8 years ago

Closing, we have a new architecture now