Commit dad56a32 authored by Adam Bramley's avatar Adam Bramley Committed by Joao Ventura
Browse files

Issue #3319610 by acbramley, jcnventura: Access to recovery codes is denied...

Issue #3319610 by acbramley, jcnventura: Access to recovery codes is denied depending on entity/database internals
parent 57b7e6a9
Loading
Loading
Loading
Loading
+1 −1
Changes for src/Plugin/Tfa/TfaRecoveryCode.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ class TfaRecoveryCode extends TfaBasePlugin implements TfaValidationInterface, T
    ];

    // Don't show codes to other users.
    if ($this->currentUser->id() !== $this->uid) {
    if ((int) $this->currentUser->id() !== (int) $this->uid) {
      unset($ret['show_codes']);
    }

+7
Changes for tests/src/Functional/TfaRecoveryCodePluginTest.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -39,6 +39,13 @@ class TfaRecoveryCodePluginTest extends TfaTestBase {
   */
  public $validationPlugin;

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'tfa_test_user',
  ];

  /**
   * {@inheritdoc}
   */