New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFA setup link hardcoded to use same validation plugin #9

Closed
talhaparacha opened this Issue Aug 6, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@talhaparacha
Copy link

talhaparacha commented Aug 6, 2016

After TFA has been enabled in a website, all users with "require tfa" permission are asked to setup TFA for their accounts. If the TFA gets enabled with HOTP validation plugin, the TFA setup link should be "user/{user}/security/tfa/HOTP". If instead, TFA gets enabled TOTP validation plugin, the TFA setup link should be "user/{user}/security/tfa/TOTP".

But currently, the setup link is hardcoded to always use the same validation plugin. That's because of the line # 148 in TfaLoginForm.php:

$tfa_setup_link = '/user/' . $account->id() . '/security/tfa/tfa_totp';
@talhaparacha

This comment has been minimized.

Copy link
Author

talhaparacha commented Aug 6, 2016

Here is how the variable should be created:

$tfa_setup_link = Url::fromRoute('tfa.validation.setup', array(
    'user' => $account->id(),
    'method' => $validate_plugin,
  ));
$tfa_setup_link = $tfa_setup_link->toString();

Also, using Url::fromRoute() is better than manually creating a relative link.

@therealssj

This comment has been minimized.

Copy link
Owner

therealssj commented Aug 11, 2016

marked for next commit

@therealssj therealssj closed this Aug 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment