Skip to content
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
paraacha opened this issue Aug 6, 2016 · 2 comments
Closed

TFA setup link hardcoded to use same validation plugin #9

paraacha opened this issue Aug 6, 2016 · 2 comments

Comments

@paraacha
Copy link

paraacha 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';
@paraacha
Copy link
Author

paraacha 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
Copy link
Owner

marked for next commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants