Problem/Motivation

The TfaContext class is an auxiliary class to the TfaLoginForm, and is not used anywhere else in the module. The fact that the module even defines an interface for this internal class, which includes the constructor has even inspired an issue to make it a service (#3291024: Move TfaContext to a factory for overridability, and remove constructor from TfaContextInterface). That was denied, as this class is not mean to be part of the public API of the module.

However, as can be seen by #2930355: Password reset bypasses TFA, there is clearly a case for being able to share the code provided by TfaContext with other classes dealing with alternative ways to login to Drupal. So instead of adding all this code back into the TfaLoginForm, it will be kept as a trait which facilitates code sharing with similar classes. This trait is going to be marked as @internal, to make it clear that it is not part of the module's public API.

Comments

jcnventura created an issue. See original summary.

jcnventura’s picture

  • 4f264b6 committed on 8.x-1.x
    Issue #3316499 by jcnventura: Refactor the TfaContext into a trait,...
jcnventura’s picture

Status: Active » Fixed

  • 4f264b6 committed on 2.x
    Issue #3316499 by jcnventura: Refactor the TfaContext into a trait,...

  • 3c0307a committed on 2.x
    Issue #3316499 by jcnventura: Further code refinements to...

  • 8958081 committed on 8.x-1.x
    Issue #3316499 by jcnventura: Further code refinements to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.