getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
354 stars 227 forks source link

admin-user-details badge still shows "2FA" after disabling 2FA #1568

Closed bleutzinn closed 5 years ago

bleutzinn commented 5 years ago

Using Grav v1.5.6 and Admin v1.8.15, enabling and then disabling 2FA leaves the admin-user-details badge showing "2FA" in the Admin panel.

This is caused by the Twig partial nav-user-details.html.twig (see line 9) which uses the setting admin.user.twofa_enabled.

This setting is set to true when enabling 2FA but appears not to set to false when 2FA is disabled later on.

As 2FA is not a per user setting but rather system wide a quick fix would be to have the Twig look at admin.twofa_enabled instead.

rhukster commented 5 years ago

I will check this out.. thanks.

rhukster commented 5 years ago

Actually, 2FA is a user and a system-wide setting...

Disabling 2FA in the plugin just means the option is not available to the user, and not checked if you have 2FA enabled for the user.

The badge indicates that the user has the option enabled. I will add an extra check to ensure both system and user options are checked for the badge to show.